From e985f15cf07cde40b3271bd1cc8e5f00cd295905 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Fri, 14 Apr 2023 09:36:36 +0800 Subject: [PATCH] fix:memset nullBitmap of SSDataBlock to 0 in udf --- include/libs/function/taosudf.h | 2 ++ source/common/src/tdatablock.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/libs/function/taosudf.h b/include/libs/function/taosudf.h index 1b1339340b..47f4956206 100644 --- a/include/libs/function/taosudf.h +++ b/include/libs/function/taosudf.h @@ -166,6 +166,8 @@ static FORCE_INLINE int32_t udfColEnsureCapacity(SUdfColumn *pColumn, int32_t ne if (tmp == NULL) { return TSDB_CODE_OUT_OF_MEMORY; } + uint32_t extend = BitmapLen(allocCapacity) - BitmapLen(data->rowsAlloc); + memset(tmp + BitmapLen(data->rowsAlloc), 0, extend); data->fixLenCol.nullBitmap = tmp; data->fixLenCol.nullBitmapLen = BitmapLen(allocCapacity); if (meta->type == TSDB_DATA_TYPE_NULL) { diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index 986a46036b..2cdcfecbdd 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -314,7 +314,8 @@ int32_t colDataMergeCol(SColumnInfoData* pColumnInfoData, int32_t numOfRow1, int if (btmp == NULL) { return TSDB_CODE_OUT_OF_MEMORY; } - + uint32_t extend = BitmapLen(finalNumOfRows) - BitmapLen(numOfRow1); + memset(btmp + BitmapLen(numOfRow1), 0, extend); pColumnInfoData->nullbitmap = btmp; }