diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index 67cc597fdf670c8d1c8b3cd578d6f4ef86cbf9a2..67f4f251f269316aab28146d0f0a435d4786116d 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -825,14 +825,17 @@ static void copyBackToBlock(SSDataBlock* pDataBlock, SColumnInfoData* pCols) { if (IS_VAR_DATA_TYPE(pColInfoData->info.type)) { taosMemoryFreeClear(pColInfoData->varmeta.offset); + pColInfoData->varmeta = pCols[i].varmeta; } else { taosMemoryFreeClear(pColInfoData->nullbitmap); + pColInfoData->nullbitmap = pCols[i].nullbitmap; } taosMemoryFreeClear(pColInfoData->pData); + pColInfoData->pData = pCols[i].pData; } - colDataDestroy(pCols); + taosMemoryFreeClear(pCols); } static int32_t* createTupleIndex(size_t rows) { @@ -1197,7 +1200,6 @@ void colDataDestroy(SColumnInfoData* pColData) { } taosMemoryFree(pColData->pData); - taosMemoryFree(pColData); } int32_t tEncodeDataBlock(void** buf, const SSDataBlock* pBlock) {