From 31d187444e7b009d3ef17c05f188e77e5493d7f0 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Mon, 17 Apr 2023 15:33:54 +0800 Subject: [PATCH] fix: grou cache issue --- source/libs/executor/src/executil.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/source/libs/executor/src/executil.c b/source/libs/executor/src/executil.c index f782add971..dc244acb40 100644 --- a/source/libs/executor/src/executil.c +++ b/source/libs/executor/src/executil.c @@ -454,7 +454,7 @@ int32_t getColInfoResultForGroupby(void* metaHandle, SNodeList* group, STableLis SSDataBlock* pResBlock = NULL; void* keyBuf = NULL; SArray* groupData = NULL; - static T_MD5_CTX lastMd5 = {0}; + static T_MD5_CTX lastMd5 = {-1}; static SArray* lastTableList = NULL; int32_t rows = taosArrayGetSize(pTableListInfo->pTableList); @@ -483,14 +483,14 @@ int32_t getColInfoResultForGroupby(void* metaHandle, SNodeList* group, STableLis } T_MD5_CTX context = {0}; - if (lastTableList) { - SNodeListNode* listNode = (SNodeListNode*)nodesMakeNode(QUERY_NODE_NODE_LIST); - listNode->pNodeList = group; - genTagFilterDigest((SNode *)listNode, &context); - if (0 == memcmp(context.digest, lastMd5.digest, sizeof(lastMd5.digest)) && (taosArrayGetSize(pTableListInfo->pTableList) == taosArrayGetSize(lastTableList))) { - pTableListInfo->pTableList = taosArrayDup(lastTableList, NULL); - goto end; - } + SNodeListNode* listNode = (SNodeListNode*)nodesMakeNode(QUERY_NODE_NODE_LIST); + listNode->pNodeList = group; + genTagFilterDigest((SNode *)listNode, &context); + taosMemoryFree(listNode); + + if (lastTableList && (0 == memcmp(context.digest, lastMd5.digest, sizeof(lastMd5.digest)) && (taosArrayGetSize(pTableListInfo->pTableList) == taosArrayGetSize(lastTableList)))) { + pTableListInfo->pTableList = taosArrayDup(lastTableList, NULL); + goto end; } SArray* pUidTagList = taosArrayInit(8, sizeof(STUidTagInfo));