commit
cb836b557e
|
@ -206,9 +206,10 @@ static void shellSourceFile(TAOS *con, char *fptr) {
|
||||||
|
|
||||||
if (code != 0) {
|
if (code != 0) {
|
||||||
fprintf(stderr, "DB error: %s: %s (%d)\n", taos_errstr(con), fname, lineNo);
|
fprintf(stderr, "DB error: %s: %s (%d)\n", taos_errstr(con), fname, lineNo);
|
||||||
/* free local resouce: allocated memory/metric-meta refcnt */
|
|
||||||
taos_free_result(pSql);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* free local resouce: allocated memory/metric-meta refcnt */
|
||||||
|
taos_free_result(pSql);
|
||||||
|
|
||||||
memset(cmd, 0, MAX_COMMAND_SIZE);
|
memset(cmd, 0, MAX_COMMAND_SIZE);
|
||||||
cmd_len = 0;
|
cmd_len = 0;
|
||||||
|
|
|
@ -520,9 +520,8 @@ int main(int argc, char *argv[]) {
|
||||||
snprintf(command, BUFFER_SIZE, "create table if not exists %s.meters (ts timestamp%s tags (areaid int, loc binary(10))", db_name, cols);
|
snprintf(command, BUFFER_SIZE, "create table if not exists %s.meters (ts timestamp%s tags (areaid int, loc binary(10))", db_name, cols);
|
||||||
queryDB(taos, command);
|
queryDB(taos, command);
|
||||||
printf("meters created!\n");
|
printf("meters created!\n");
|
||||||
|
|
||||||
taos_close(taos);
|
|
||||||
}
|
}
|
||||||
|
taos_close(taos);
|
||||||
|
|
||||||
/* Wait for table to create */
|
/* Wait for table to create */
|
||||||
multiThreadCreateTable(cols, use_metric, threads, ntables, db_name, tb_prefix, ip_addr, port, user, pass);
|
multiThreadCreateTable(cols, use_metric, threads, ntables, db_name, tb_prefix, ip_addr, port, user, pass);
|
||||||
|
@ -792,9 +791,6 @@ void * createTable(void *sarg)
|
||||||
snprintf(command, BUFFER_SIZE, "create table if not exists %s.%s%d (ts timestamp%s;", winfo->db_name, winfo->tb_prefix, i, winfo->cols);
|
snprintf(command, BUFFER_SIZE, "create table if not exists %s.%s%d (ts timestamp%s;", winfo->db_name, winfo->tb_prefix, i, winfo->cols);
|
||||||
queryDB(winfo->taos, command);
|
queryDB(winfo->taos, command);
|
||||||
}
|
}
|
||||||
|
|
||||||
taos_close(winfo->taos);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/* Create all the tables; */
|
/* Create all the tables; */
|
||||||
printf("Creating table from %d to %d\n", winfo->start_table_id, winfo->end_table_id);
|
printf("Creating table from %d to %d\n", winfo->start_table_id, winfo->end_table_id);
|
||||||
|
@ -812,7 +808,6 @@ void * createTable(void *sarg)
|
||||||
}
|
}
|
||||||
queryDB(winfo->taos, command);
|
queryDB(winfo->taos, command);
|
||||||
}
|
}
|
||||||
taos_close(winfo->taos);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in New Issue