From b671d723b084dc3306dfe381a461aaa3d2b17a10 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 26 Apr 2021 11:03:19 +0800 Subject: [PATCH] [td-225]fix bug found by crash_gen --- src/client/src/tscSubquery.c | 1 - src/client/src/tscUtil.c | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index ecfce83010..79fb407069 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -667,7 +667,6 @@ static int32_t tscLaunchRealSubqueries(SSqlObj* pSql) { continue; } -// tscDoQuery(pSql->pSubs[i]); SQueryInfo* pQueryInfo = tscGetQueryInfo(&pSql->pSubs[i]->cmd, 0); executeQuery(pSql->pSubs[i], pQueryInfo); } diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 566e86d9a2..2f304a8fea 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -2783,6 +2783,11 @@ void doExecuteQuery(SSqlObj* pSql, SQueryInfo* pQueryInfo) { // do execute the query according to the query execution plan void executeQuery(SSqlObj* pSql, SQueryInfo* pQueryInfo) { + if (pSql->cmd.command == TSDB_SQL_RETRIEVE_EMPTY_RESULT) { + (*pSql->fp)(pSql->param, pSql, 0); + return; + } + if (taosArrayGetSize(pQueryInfo->pUpstream) > 0) { // nest query. do execute it firstly SQueryInfo* pq = taosArrayGetP(pQueryInfo->pUpstream, 0);