1 //TestCase: We need to start new server to test this.
2 //the default db size set is not enough to test this
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;}
13 tabDef
.addField("f1", typeInt
, 0, NULL
, true);
14 tabDef
.addField("f2", typeInt
);
15 rv
= dbMgr
->createTable("t1", tabDef
);
16 if (rv
!= OK
) { printf("Table creation failed\n"); conn
.close(); return 3; }
17 printf("Table created\n");
19 Table
*table
= dbMgr
->openTable("t1");
22 printf("Unable to open table\n");
23 dbMgr
->dropTable("t1");
28 table
->bindFld("f1", &id1
);
29 table
->bindFld("f2", &id2
);
31 for (int i
= 0 ; i
< 10000 ; i
++)
33 conn
.startTransaction();
34 for (int j
= 0 ; j
< 100 ; j
++) {
36 rv
= table
->insertTuple();
42 printf("Tuples inserted %d\n", icount
);
43 table
->setCondition(NULL
);
44 rv
= table
->execute();
47 dbMgr
->closeTable(table
);
48 dbMgr
->dropTable("t1");
51 void *fld2ptr
, *fld3ptr
, *tuple
;
55 tuple
= (char*)table
->fetch() ;
56 if (tuple
== NULL
) {break;}
60 dbMgr
->closeTable(table
);
61 dbMgr
->dropTable("t1");
63 if (icount
!= 1000000) return 3;