TAOS_RES*result=taos_query(taos,"drop database if exists db");
if(result==NULL||taos_errno(result)!=0){
printf("In line:%d, failed to execute sql, reason:%s\n",__LINE__,taos_errstr(result));
taos_free_result(result);
exit(EXIT_FAILURE);
}
taos_free_result(result);
int64_telapsed=getTimeStampMs()-st;
printf("--- spend %ld ms to drop database db\n",elapsed);
st=getTimeStampMs();
result=taos_query(taos,"create database if not exists db");
if(result==NULL||taos_errno(result)!=0){
printf("In line:%d, failed to execute sql, reason:%s\n",__LINE__,taos_errstr(result));
taos_free_result(result);
exit(EXIT_FAILURE);
}
taos_free_result(result);
elapsed=getTimeStampMs()-st;
printf("--- spend %ld ms to create database db\n",elapsed);
st=getTimeStampMs();
start();
printf("--- Spend %ld ms to create %d super tables and each %d tables\n",elapsed,arguments.stable,arguments.table);
}
voidcreateImp(void*param){
charcommand[256]="\0";
intsqlLen=0;
intcount=0;
char*sql=calloc(1,1024*1024);
ThreadObj*pThread=(ThreadObj*)param;
printf("Thread %d start create super table s%d to s%d\n",pThread->threadId,(pThread->threadId-1)*arguments.stable/arguments.client,pThread->threadId*arguments.stable/arguments.client-1);