From ecc05bf75c540a1cccd34682659ab1858da46325 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 22 Jun 2022 21:12:08 +0800 Subject: [PATCH] fix(query): check pointer before use it. --- source/common/src/tdatablock.c | 3 --- source/libs/function/src/builtinsimpl.c | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index 4f513335eb..168d949631 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -1880,9 +1880,6 @@ const char* blockCompressDecode(SSDataBlock* pBlock, int32_t numOfCols, int32_t SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, i); if (IS_VAR_DATA_TYPE(pColInfoData->info.type)) { -// pColInfoData->varmeta.length = colLen[i]; -// pColInfoData->varmeta.allocLen = colLen[i]; - memcpy(pColInfoData->varmeta.offset, pStart, sizeof(int32_t) * numOfRows); pStart += sizeof(int32_t) * numOfRows; diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index 4d869705ad..b0de3b3364 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -1450,8 +1450,8 @@ void setSelectivityValue(SqlFunctionCtx* pCtx, SSDataBlock* pBlock, const STuple int32_t pageId = pTuplePos->pageId; int32_t offset = pTuplePos->offset; - int32_t numOfCols = taosArrayGetSize(pCtx->pSrcBlock->pDataBlock); if (pTuplePos->pageId != -1) { + int32_t numOfCols = taosArrayGetSize(pCtx->pSrcBlock->pDataBlock); SFilePage* pPage = getBufPage(pCtx->pBuf, pageId); bool* nullList = (bool*)((char*)pPage + offset);