From 868ee10750a7b40bbd81cdea2df4a0786160c552 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Sat, 27 Mar 2021 19:56:45 +0800 Subject: [PATCH] [TD-3546] : fix taosdemo quer crash as index variable mistake. (#5598) Co-authored-by: Shuduo Sang --- src/kit/taosdemo/taosdemo.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/kit/taosdemo/taosdemo.c b/src/kit/taosdemo/taosdemo.c index 9e8e974096..c2387fc7d9 100644 --- a/src/kit/taosdemo/taosdemo.c +++ b/src/kit/taosdemo/taosdemo.c @@ -5578,9 +5578,9 @@ static void *subQueryProcess(void *sarg) { memset(sqlstr,0,sizeof(sqlstr)); replaceSubTblName(g_queryInfo.subQueryInfo.sql[j], sqlstr, i); 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", - g_queryInfo.subQueryInfo.result[i], + g_queryInfo.subQueryInfo.result[j], winfo->threadID); } selectAndGetResult(winfo->taos, sqlstr, tmpFile); @@ -5825,7 +5825,8 @@ static void *subSubscribeProcess(void *sarg) { replaceSubTblName(g_queryInfo.subQueryInfo.sql[i], subSqlstr, i); char tmpFile[MAX_FILE_NAME_LEN*2] = {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( winfo->taos, subSqlstr, topic, tmpFile); -- GitLab