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

[TD-3589] <fix>: taosdemo need to use db before query. (#5612)

Co-authored-by: NShuduo Sang <sdsang@taosdata.com>
上级 ea1508bf
...@@ -5526,9 +5526,14 @@ static void *superQueryProcess(void *sarg) { ...@@ -5526,9 +5526,14 @@ static void *superQueryProcess(void *sarg) {
} }
} }
//char sqlStr[MAX_TB_NAME_SIZE*2]; char sqlStr[MAX_DB_NAME_SIZE + 5];
//sprintf(sqlStr, "use %s", g_queryInfo.dbName); sprintf(sqlStr, "use %s", g_queryInfo.dbName);
//queryDB(winfo->taos, sqlStr); if (0 != queryDbExec(winfo->taos, sqlStr, NO_INSERT_TYPE, false)) {
taos_close(winfo->taos);
errorPrint( "use database %s failed!\n\n",
g_queryInfo.dbName);
return NULL;
}
int64_t st = 0; int64_t st = 0;
int64_t et = 0; int64_t et = 0;
...@@ -5861,9 +5866,10 @@ static void *subSubscribeProcess(void *sarg) { ...@@ -5861,9 +5866,10 @@ static void *subSubscribeProcess(void *sarg) {
char sqlStr[MAX_TB_NAME_SIZE*2]; char sqlStr[MAX_TB_NAME_SIZE*2];
sprintf(sqlStr, "use %s", g_queryInfo.dbName); sprintf(sqlStr, "use %s", g_queryInfo.dbName);
debugPrint("%s() %d sqlStr: %s\n", __func__, __LINE__, sqlStr);
if (0 != queryDbExec(winfo->taos, sqlStr, NO_INSERT_TYPE, false)) { if (0 != queryDbExec(winfo->taos, sqlStr, NO_INSERT_TYPE, false)) {
taos_close(winfo->taos); taos_close(winfo->taos);
errorPrint( "use database %s failed!\n\n",
g_queryInfo.dbName);
return NULL; return NULL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册