From ce9f1e5baefbdf36c26236fe439fd1f57b19f727 Mon Sep 17 00:00:00 2001 From: hjxilinx Date: Mon, 6 Jan 2020 17:57:23 +0800 Subject: [PATCH] fix release buffer failed bug --- src/system/detail/src/vnodeQueryImpl.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/system/detail/src/vnodeQueryImpl.c b/src/system/detail/src/vnodeQueryImpl.c index e3b1f60d49..793903d2db 100644 --- a/src/system/detail/src/vnodeQueryImpl.c +++ b/src/system/detail/src/vnodeQueryImpl.c @@ -5861,7 +5861,8 @@ static void clearAllMeterDataBlockInfo(SMeterDataInfo** pMeterDataInfo, int32_t for(int32_t i = start; i < end; ++i) { tfree(pMeterDataInfo[i]->pBlock); pMeterDataInfo[i]->numOfBlocks = 0; - pMeterDataInfo[i]->start = 0; } + pMeterDataInfo[i]->start = 0; + } } static bool getValidDataBlocksRangeIndex(SMeterDataInfo *pMeterDataInfo, SQuery *pQuery, SCompBlock *pCompBlock, @@ -6013,14 +6014,15 @@ int32_t getDataBlocksForMeters(SMeterQuerySupportObj *pSupporter, SQuery *pQuery pSummary->loadCompInfoUs += (et - st); if (!setCurrentQueryRange(pMeterDataInfo[j], pQuery, pSupporter->rawEKey, &minval, &maxval)) { - clearAllMeterDataBlockInfo(pMeterDataInfo, j, j); + clearAllMeterDataBlockInfo(pMeterDataInfo, j, j + 1); continue; } int32_t end = 0; if (!getValidDataBlocksRangeIndex(pMeterDataInfo[j], pQuery, pMeterDataInfo[j]->pBlock, compInfo.numOfBlocks, minval, maxval, &end)) { - clearAllMeterDataBlockInfo(pMeterDataInfo, j, j); + // current table has no qualified data blocks, erase its information. + clearAllMeterDataBlockInfo(pMeterDataInfo, j, j + 1); continue; } -- GitLab