Test Scripts For TableDef
[csql.git] / test / dbapi / TableDef / fieldcount1.c
blob6347795f519d971c48cd6d0deb1726eee52723e7
1 //100 times addField f1 and dropField f1. getFldCount() should return 0
2 #include<CSql.h>
3 int main()
5 Connection conn;
6 DbRetVal rv = conn.open("root", "manager");
7 if (rv != OK) return 1;
8 DatabaseManager *dbMgr = conn.getDatabaseManager();
9 if (dbMgr == NULL) { printf("Auth failed\n"); return 2;}
11 TableDef tabDef;
12 for (int i=0;i<100;i++)
14 tabDef.addField("f1", typeInt);
15 tabDef.dropField("f1");
17 int fieldcount=tabDef.getFieldCount();
18 printf("Number of Fields = %d\n",fieldcount);
19 printf("Test Passed\n");
20 conn.close();
21 return 0;