test cases for trie index
[csql.git] / test / dbapi / Index / uniqueindex3.c
blob4586d627fd7348a37d27a0544c78796c3baa8ea1
1 #include<CSql.h>
2 #define DEFAULT
3 #include "common.h"
4 //test with default value for isUnique of IndexInitInfo
5 int main()
7 Connection conn;
8 DbRetVal rv = conn.open("root", "manager");
9 if (rv != OK) return 1;
10 DatabaseManager *dbMgr = conn.getDatabaseManager();
11 if (dbMgr == NULL) { printf("Auth failed\n"); return 2;}
13 if ( createTable(dbMgr) != 0 ) { conn.close(); return 3; }
14 if ( createIndex(dbMgr, false) != 0 ) { dbMgr->dropTable("t1");conn.close(); return 4;
16 int inscount = insertTupleWithSameValue(dbMgr, conn);
17 if (inscount != 10 ) { dbMgr->dropTable("t1"); conn.close(); return 5; }
18 dbMgr->dropTable("t1");
19 conn.close();
20 return 0;