From 91e987b25a5310619650e40287c68999517ce154 Mon Sep 17 00:00:00 2001 From: 54liuyao <54liuyao> Date: Mon, 12 Aug 2024 14:01:55 +0800 Subject: [PATCH] fix issue --- source/libs/executor/src/tsort.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/source/libs/executor/src/tsort.c b/source/libs/executor/src/tsort.c index cedc23ed2d..5bd11489c9 100644 --- a/source/libs/executor/src/tsort.c +++ b/source/libs/executor/src/tsort.c @@ -1917,14 +1917,21 @@ static int32_t getBufIncForNewRow(SSortHandle* pHandle, int32_t dstRowIndex, SSD } static int32_t initMergeSup(SBlkMergeSupport* pSup, SArray* pBlockList, int32_t tsOrder, int32_t tsSlotId, SBlockOrderInfo* pPkOrderInfo) { + int32_t code = TSDB_CODE_SUCCESS; + int32_t lino = 0; memset(pSup, 0, sizeof(SBlkMergeSupport)); int32_t numOfBlocks = taosArrayGetSize(pBlockList); pSup->aRowIdx = taosMemoryCalloc(numOfBlocks, sizeof(int32_t)); + QUERY_CHECK_NULL(pSup->aRowIdx, code, lino, _end, terrno); + pSup->aTs = taosMemoryCalloc(numOfBlocks, sizeof(int64_t*)); + QUERY_CHECK_NULL(pSup->aTs, code, lino, _end, terrno); + pSup->tsOrder = tsOrder; pSup->aBlks = taosMemoryCalloc(numOfBlocks, sizeof(SSDataBlock*)); + QUERY_CHECK_NULL(pSup->aBlks, code, lino, _end, terrno); for (int32_t i = 0; i < numOfBlocks; ++i) { SSDataBlock* pBlock = taosArrayGetP(pBlockList, i); @@ -1935,7 +1942,12 @@ static int32_t initMergeSup(SBlkMergeSupport* pSup, SArray* pBlockList, int32_t } pSup->pPkOrder = pPkOrderInfo; - return TSDB_CODE_SUCCESS; + +_end: + if (code != TSDB_CODE_SUCCESS) { + qError("%s failed at line %d since %s", __func__, lino, tstrerror(code)); + } + return code; } static void cleanupMergeSup(SBlkMergeSupport* pSup) {