提交 1c471daf 编写于 作者: sangshuduo's avatar sangshuduo

fix mac compile error.

上级 40c818d3
......@@ -2891,7 +2891,8 @@ static int createSuperTable(
TAOS * taos, char* dbName,
SSuperTable* superTbl) {
char command[1024] = "\0";
char *command = calloc(1, BUFFER_SIZE);
assert(command);
char cols[COL_BUFFER_LEN] = "\0";
int colIndex;
......@@ -2902,6 +2903,7 @@ static int createSuperTable(
if (superTbl->columnCount == 0) {
errorPrint("%s() LN%d, super table column count is %d\n",
__func__, __LINE__, superTbl->columnCount);
free(command);
return -1;
}
......@@ -2964,6 +2966,7 @@ static int createSuperTable(
taos_close(taos);
errorPrint("%s() LN%d, config error data type : %s\n",
__func__, __LINE__, dataType);
free(command);
exit(-1);
}
}
......@@ -2976,6 +2979,7 @@ static int createSuperTable(
errorPrint("%s() LN%d, Failed when calloc, size:%d",
__func__, __LINE__, len+1);
taos_close(taos);
free(command);
exit(-1);
}
......@@ -2986,6 +2990,7 @@ static int createSuperTable(
if (superTbl->tagCount == 0) {
errorPrint("%s() LN%d, super table tag count is %d\n",
__func__, __LINE__, superTbl->tagCount);
free(command);
return -1;
}
......@@ -3051,6 +3056,7 @@ static int createSuperTable(
taos_close(taos);
errorPrint("%s() LN%d, config error tag type : %s\n",
__func__, __LINE__, dataType);
free(command);
exit(-1);
}
}
......@@ -3060,15 +3066,18 @@ static int createSuperTable(
superTbl->lenOfTagOfOneRow = lenOfTagOfOneRow;
snprintf(command, 1024,
snprintf(command, BUFFER_SIZE,
"create table if not exists %s.%s (ts timestamp%s) tags %s",
dbName, superTbl->sTblName, cols, tags);
if (0 != queryDbExec(taos, command, NO_INSERT_TYPE, false)) {
errorPrint( "create supertable %s failed!\n\n",
superTbl->sTblName);
free(command);
return -1;
}
debugPrint("create supertable %s success!\n\n", superTbl->sTblName);
free(command);
return 0;
}
......@@ -7717,7 +7726,7 @@ static void *superTableQuery(void *sarg) {
st = taosGetTimestampMs();
for (int i = pThreadInfo->start_table_from; i <= pThreadInfo->end_table_to; i++) {
for (int j = 0; j < g_queryInfo.superQueryInfo.sqlCount; j++) {
memset(sqlstr,0,sizeof(sqlstr));
memset(sqlstr, 0, BUFFER_SIZE);
replaceChildTblName(g_queryInfo.superQueryInfo.sql[j], sqlstr, i);
if (g_queryInfo.superQueryInfo.result[j][0] != '\0') {
sprintf(pThreadInfo->filePath, "%s-%d",
......@@ -8032,7 +8041,7 @@ static void *superSubscribe(void *sarg) {
pThreadInfo->end_table_to, i);
sprintf(topic, "taosdemo-subscribe-%"PRIu64"-%"PRIu64"",
i, pThreadInfo->querySeq);
memset(subSqlStr, 0, sizeof(subSqlStr));
memset(subSqlStr, 0, BUFFER_SIZE);
replaceChildTblName(
g_queryInfo.superQueryInfo.sql[pThreadInfo->querySeq],
subSqlStr, i);
......@@ -8437,9 +8446,7 @@ static void setParaFromArg() {
tstrncpy(g_Dbs.user, g_args.user, MAX_USERNAME_SIZE);
}
if (g_args.password) {
tstrncpy(g_Dbs.password, g_args.password, MAX_PASSWORD_SIZE);
}
tstrncpy(g_Dbs.password, g_args.password, MAX_PASSWORD_SIZE);
if (g_args.port) {
g_Dbs.port = g_args.port;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册