From a0c92acd56e5eb53d8ffd0e5312ee256b524edf1 Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Thu, 5 May 2022 19:50:49 +0800 Subject: [PATCH] deal with not all columns has agg --- source/common/src/tdatablock.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index dcea167e81..cc7bcabee0 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -491,7 +491,12 @@ SSDataBlock* blockDataExtractBlock(SSDataBlock* pBlock, int32_t startIndex, int3 SColumnInfoData* pDstCol = taosArrayGet(pDst->pDataBlock, i); for (int32_t j = startIndex; j < (startIndex + rowCount); ++j) { - bool isNull = colDataIsNull(pColData, pBlock->info.rows, j, pBlock->pBlockAgg[i]); + bool isNull = false; + if (pBlock->pBlockAgg == NULL) { + isNull = colDataIsNull(pColData, pBlock->info.rows, j, NULL); + } else { + isNull = colDataIsNull(pColData, pBlock->info.rows, j, pBlock->pBlockAgg[i]); + } char* p = colDataGetData(pColData, j); colDataAppend(pDstCol, j - startIndex, p, isNull); -- GitLab