From 5e0fba93a134ddb20eeb8597a85c3a5ada6825df Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 3 Nov 2020 10:06:44 +0800 Subject: [PATCH] [TD-225] refactor. --- src/client/src/tscSubquery.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index 1299357d84..786e237a53 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -1048,6 +1048,7 @@ static void joinRetrieveFinalResCallback(void* param, TAOS_RES* tres, int numOfR } // update the records for each subquery in parent sql object. + bool isSTableSub = tscIsTwoStageSTableQuery(pQueryInfo, 0); for (int32_t i = 0; i < pState->numOfSub; ++i) { if (pParentSql->pSubs[i] == NULL) { tscDebug("%p %p sub:%d not retrieve data", pParentSql, NULL, i); @@ -1061,8 +1062,7 @@ static void joinRetrieveFinalResCallback(void* param, TAOS_RES* tres, int numOfR pRes1->numOfRows, pRes1->numOfTotal); assert(pRes1->row < pRes1->numOfRows); } else { - SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(&pParentSql->pSubs[i]->cmd, 0); - if (!tscIsTwoStageSTableQuery(pQueryInfo, 0)) { + if (!isSTableSub) { pRes1->numOfClauseTotal += pRes1->numOfRows; }