From e8c041f09856e5845be679718c9a52868d1ce0f7 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Thu, 14 Jul 2022 10:49:09 +0800 Subject: [PATCH] fix:filter child table with tag --- source/libs/executor/src/executil.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/source/libs/executor/src/executil.c b/source/libs/executor/src/executil.c index 2469062d09..6b2bea273d 100644 --- a/source/libs/executor/src/executil.c +++ b/source/libs/executor/src/executil.c @@ -347,25 +347,25 @@ int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode, terrno = code; return code; } - - if (pTagCond) { - int32_t i = 0; - while (i < taosArrayGetSize(pListInfo->pTableList)) { - STableKeyInfo* info = taosArrayGet(pListInfo->pTableList, i); - bool isOk = isTableOk(info, pTagCond, metaHandle); - if (terrno) return terrno; - if (!isOk) { - taosArrayRemove(pListInfo->pTableList, i); - continue; - } - i++; - } - } } else { // Create one table group. STableKeyInfo info = {.lastKey = 0, .uid = tableUid, .groupId = 0}; taosArrayPush(pListInfo->pTableList, &info); } + if (pTagCond) { + int32_t i = 0; + while (i < taosArrayGetSize(pListInfo->pTableList)) { + STableKeyInfo* info = taosArrayGet(pListInfo->pTableList, i); + bool isOk = isTableOk(info, pTagCond, metaHandle); + if (terrno) return terrno; + if (!isOk) { + taosArrayRemove(pListInfo->pTableList, i); + continue; + } + i++; + } + } + pListInfo->pGroupList = taosArrayInit(4, POINTER_BYTES); if (pListInfo->pGroupList == NULL) { return TSDB_CODE_OUT_OF_MEMORY;