1 //addfield f1 int, addField f2 char(10), addField f3 int.
2 //Check the getTupleSize() return value. It should be 20
7 DbRetVal rv
= conn
.open("root", "manager");
8 if (rv
!= OK
) return 1;
9 DatabaseManager
*dbMgr
= conn
.getDatabaseManager();
10 if (dbMgr
== NULL
) { printf("Auth failed\n"); return 2;}
14 tabDef
.addField("f1", typeInt
, 0, NULL
, true);
15 tabDef
.addField("f2", typeString
,10);
16 tabDef
.addField("f3", typeInt
);
18 dbMgr
->createTable("t1", tabDef
);
19 printf("Table created\n");
20 size_t sizeofTuple
= os::align(tabDef
.getTupleSize());
21 printf("Size of 1 tuple is %d\n",sizeofTuple
);
23 dbMgr
->dropTable("t1");