From 75e0ce8cbc16d10dd16e665038d382772be90c2d Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 8 May 2024 18:25:56 +0800 Subject: [PATCH] fix(query): calculate the correct dst row length. --- source/libs/executor/src/tsort.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/libs/executor/src/tsort.c b/source/libs/executor/src/tsort.c index 2ef40cd738..906fe0626b 100644 --- a/source/libs/executor/src/tsort.c +++ b/source/libs/executor/src/tsort.c @@ -1484,10 +1484,16 @@ static int32_t getPageBufIncForRowIdSort(SSDataBlock* pDstBlock, int32_t srcRowI int32_t numOfCols = blockDataGetNumOfCols(pDstBlock); if (pPkCol == NULL) { - ASSERT(!pDstBlock->info.hasVarCol); + ASSERT((numOfCols == 4) && (!pDstBlock->info.hasVarCol)); + size += numOfCols * ((dstRowIndex & 0x7) == 0 ? 1: 0); size += blockDataGetRowSize(pDstBlock); } else { + ASSERT(numOfCols == 5); + + size += (numOfCols - 1) * (((dstRowIndex & 0x7) == 0)? 1:0); + size += (8 + 4 + 4 + 4); // todo refactor later + if (IS_VAR_DATA_TYPE(pPkCol->info.type)) { if ((pPkCol->varmeta.offset[srcRowIndex] != -1) && (pPkCol->pData)) { char* p = colDataGetData(pPkCol, srcRowIndex);