未验证 提交 868ee107 编写于 作者: sangshuduo's avatar sangshuduo 提交者: GitHub

[TD-3546] <fix>: fix taosdemo quer crash as index variable mistake. (#5598)

Co-authored-by: NShuduo Sang <sdsang@taosdata.com>
上级 2c4bcbe3
...@@ -5578,9 +5578,9 @@ static void *subQueryProcess(void *sarg) { ...@@ -5578,9 +5578,9 @@ static void *subQueryProcess(void *sarg) {
memset(sqlstr,0,sizeof(sqlstr)); memset(sqlstr,0,sizeof(sqlstr));
replaceSubTblName(g_queryInfo.subQueryInfo.sql[j], sqlstr, i); replaceSubTblName(g_queryInfo.subQueryInfo.sql[j], sqlstr, i);
char tmpFile[MAX_FILE_NAME_LEN*2] = {0}; char tmpFile[MAX_FILE_NAME_LEN*2] = {0};
if (g_queryInfo.subQueryInfo.result[i][0] != 0) { if (g_queryInfo.subQueryInfo.result[j][0] != 0) {
sprintf(tmpFile, "%s-%d", sprintf(tmpFile, "%s-%d",
g_queryInfo.subQueryInfo.result[i], g_queryInfo.subQueryInfo.result[j],
winfo->threadID); winfo->threadID);
} }
selectAndGetResult(winfo->taos, sqlstr, tmpFile); selectAndGetResult(winfo->taos, sqlstr, tmpFile);
...@@ -5825,7 +5825,8 @@ static void *subSubscribeProcess(void *sarg) { ...@@ -5825,7 +5825,8 @@ static void *subSubscribeProcess(void *sarg) {
replaceSubTblName(g_queryInfo.subQueryInfo.sql[i], subSqlstr, i); replaceSubTblName(g_queryInfo.subQueryInfo.sql[i], subSqlstr, i);
char tmpFile[MAX_FILE_NAME_LEN*2] = {0}; char tmpFile[MAX_FILE_NAME_LEN*2] = {0};
if (g_queryInfo.subQueryInfo.result[i][0] != 0) { if (g_queryInfo.subQueryInfo.result[i][0] != 0) {
sprintf(tmpFile, "%s-%d", g_queryInfo.subQueryInfo.result[i], winfo->threadID); sprintf(tmpFile, "%s-%d",
g_queryInfo.subQueryInfo.result[i], winfo->threadID);
} }
g_queryInfo.subQueryInfo.tsub[i] = subscribeImpl( g_queryInfo.subQueryInfo.tsub[i] = subscribeImpl(
winfo->taos, subSqlstr, topic, tmpFile); winfo->taos, subSqlstr, topic, tmpFile);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册