[td-225]fix bug found by crash_gen

This commit is contained in:
Haojun Liao 2021-04-26 11:03:19 +08:00
parent a06a1fb370
commit b671d723b0
2 changed files with 5 additions and 1 deletions

View File

@ -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);
}

View File

@ -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);