From 46e1438c2aac136d43203d12ba62786aa5cf81a5 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Fri, 25 Nov 2022 18:16:27 +0800 Subject: [PATCH] fix(query): check the error code, if the downstream is an exchange operator. --- source/libs/executor/src/executorimpl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 4319dd379a..cc2c68769e 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -1641,11 +1641,16 @@ static int32_t doOpenAggregateOptr(SOperatorInfo* pOperator) { } } + // the downstream operator may return with error code, so let's check the code before generating results. + if (pTaskInfo->code != TSDB_CODE_SUCCESS) { + T_LONG_JMP(pTaskInfo->env, pTaskInfo->code); + } + initGroupedResultInfo(&pAggInfo->groupResInfo, pAggInfo->aggSup.pResultRowHashTable, 0); OPTR_SET_OPENED(pOperator); pOperator->cost.openCost = (taosGetTimestampUs() - st) / 1000.0; - return TSDB_CODE_SUCCESS; + return pTaskInfo->code; } static SSDataBlock* getAggregateResult(SOperatorInfo* pOperator) {