diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index b8321679e8926bbdbe2d7dd88f928da0c8f5761c..1d27bbb76584fc365c4ee7ea6c5da1c40e3259e1 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 16fbe7d1dbf9c28062e4a8de113c0ac9262d7938..937069b5cc013110369605096d57c49c76e9986b 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);