1 /**********************************************************
4 * create index if specified
6 * start new transaction
8 * check transaction statistics
10 * check transaction statistics
13 #include <DatabaseManagerImpl.h>
17 DbRetVal rv
= conn
.open("root", "manager");
18 if (rv
!= OK
) return 1;
19 DatabaseManagerImpl
*dbMgr
= (DatabaseManagerImpl
*) conn
.getDatabaseManager();
20 if (dbMgr
== NULL
) { printf("Auth failed\n"); return 2;}
22 if (createTable(dbMgr
, "t1") != 0 ) { ret
= 3; }
24 if (createIndex(dbMgr
, "t1","f1", "idx1") != 0 ) { ret
= 4; }
26 rv
= conn
.startTransaction();
27 if (rv
!= OK
) ret
= 5;
28 rc
= insertTuple(dbMgr
, conn
, "t1", 10);
29 if (rc
!= 10) ret
= 6;
32 rv
= conn
.startTransaction();
33 if (rv
!= OK
) ret
= 5;
34 rc
= updateTuple(dbMgr
, conn
, "t1", 10);
35 if (rc
!= 10) ret
= 6;
37 printf("Before abort\n");
38 dbMgr
->printDebugTransInfo();
40 printf("After abort\n");
41 dbMgr
->printDebugTransInfo();
42 dropTable(dbMgr
,"t1");