diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 063eece4ffb8e601c0276d268c0a4339db2fda28..1c1f3914a32de75274ed644bae5fb6c2956751e4 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -4409,6 +4409,11 @@ SArray* getResultGroupCheckColumns(SQueryAttr* pQuery) { return pOrderColumns; } +static void destroyGlobalAggOperatorInfo(void* param, int32_t numOfOutput) { + SMultiwayMergeInfo *pInfo = (SMultiwayMergeInfo*) param; + destroyBasicOperatorInfo(&pInfo->binfo, numOfOutput); +} + SOperatorInfo* createGlobalAggregateOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOperatorInfo* upstream, SExprInfo* pExpr, int32_t numOfOutput, void* param) { SMultiwayMergeInfo* pInfo = calloc(1, sizeof(SMultiwayMergeInfo)); @@ -4471,7 +4476,7 @@ SOperatorInfo* createGlobalAggregateOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, pOperator->pRuntimeEnv = pRuntimeEnv; pOperator->exec = doGlobalAggregate; - pOperator->cleanup = destroyBasicOperatorInfo; + pOperator->cleanup = destroyGlobalAggOperatorInfo; return pOperator; } diff --git a/src/query/src/qSqlParser.c b/src/query/src/qSqlParser.c index f51e87f40441b464235d0554cf352219663555ae..ea8e45e63ff4ca0241db1e99b1e55d3961f57756 100644 --- a/src/query/src/qSqlParser.c +++ b/src/query/src/qSqlParser.c @@ -744,7 +744,7 @@ void destroyAllSqlNode(SArray *pList) { size_t size = taosArrayGetSize(pList); for(int32_t i = 0; i < size; ++i) { - SSqlNode *pNode = taosArrayGetP(pList, 0); + SSqlNode *pNode = taosArrayGetP(pList, i); destroySqlNode(pNode); }