*** empty log message ***
[csql.git] / test / system / Allocator / tuplesize5.c
blob29bb9fda356951364f5261499bc9954bfd1247dc
1 /**********************************************************
2 * Test Case
3 * create table t1 with int
4 * create index if specified
5 * check table information for tuple size
6 */
7 #include <CSql.h>
8 #include <TableImpl.h>
9 #include <DatabaseManagerImpl.h>
10 int main()
12 Connection conn;
13 DbRetVal rv = conn.open("root", "manager");
14 if (rv != OK) return 1;
15 DatabaseManagerImpl *dbMgr = (DatabaseManagerImpl*) conn.getDatabaseManager();
16 if (dbMgr == NULL) { printf("Auth failed\n"); return 2;}
17 int ret =0, rc =0;
19 TableDef tabDef;
20 tabDef.addField("f1", typeInt, 0, NULL, true);
21 tabDef.addField("f2", typeString, 1);
22 tabDef.addField("f3", typeInt);
23 tabDef.addField("f4", typeString, 5);
24 tabDef.addField("f5", typeInt);
25 rv = dbMgr->createTable("t1", tabDef);
26 if (rv != OK) { printf("Table creation failed\n"); return rv; }
27 printf("Table created\n");
29 if (rv != OK) ret = 5;
30 TableImpl *table = (TableImpl*) dbMgr->openTable("t1");
31 table->printInfo();
32 dbMgr->closeTable((Table*)table);
33 dbMgr->dropTable("t1");
34 conn.close();
35 return ret;