From f44dd569cca6470c03c5c6a2133acebdf8d1bb2e Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Sun, 6 Nov 2022 16:09:19 +0800 Subject: [PATCH] fix(query): remove the invalid capacity changing. --- source/common/src/tdatablock.c | 2 +- source/libs/executor/src/scanoperator.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index b8321679e8..1d27bbb765 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -246,7 +246,7 @@ int32_t colDataMergeCol(SColumnInfoData* pColumnInfoData, int32_t numOfRow1, int uint32_t finalNumOfRows = numOfRow1 + numOfRow2; if (IS_VAR_DATA_TYPE(pColumnInfoData->info.type)) { // Handle the bitmap - if (finalNumOfRows > *capacity || (numOfRow1 == 0 && pColumnInfoData->info.bytes != 0)) { + if (finalNumOfRows > (*capacity)) { char* p = taosMemoryRealloc(pColumnInfoData->varmeta.offset, sizeof(int32_t) * (numOfRow1 + numOfRow2)); if (p == NULL) { return TSDB_CODE_OUT_OF_MEMORY; diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 16fbe7d1db..937069b5cc 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -620,7 +620,7 @@ static SSDataBlock* doTableScanImpl(SOperatorInfo* pOperator) { int32_t rows = 0; tsdbRetrieveDataBlockInfo(pTableScanInfo->dataReader, &rows, &pBInfo->uid, &pBInfo->window); - blockDataEnsureCapacity(pBlock, rows); + blockDataEnsureCapacity(pBlock, rows); // todo remove it latter pBInfo->rows = rows; ASSERT(pBInfo->uid != 0);