From f72f129d411a6a7cabd8d36c2e1685884359643a Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Tue, 1 Aug 2023 17:23:53 +0800 Subject: [PATCH] cache/skyline: cleanup del array --- source/dnode/vnode/src/tsdb/tsdbCache.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c index 7706fbd501..4ed5c9dcc4 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCache.c +++ b/source/dnode/vnode/src/tsdb/tsdbCache.c @@ -2502,15 +2502,15 @@ static int32_t nextRowIterGet(CacheNextRowIter *pIter, TSDBROW **ppRow, bool *pI uint64_t uid = pIter->idx.uid; STableLoadInfo *pInfo = getTableLoadInfo(pIter->pr, uid); - SArray *pTombData = pInfo->pTombData; - - if (pTombData) { - taosArrayAddAll(pIter->pMemDelData, pTombData); + if (pInfo->pTombData == NULL) { + pInfo->pTombData = taosArrayInit(4, sizeof(SDelData)); } - size_t delSize = TARRAY_SIZE(pIter->pMemDelData); + taosArrayAddAll(pInfo->pTombData, pIter->pMemDelData); + + size_t delSize = TARRAY_SIZE(pInfo->pTombData); if (delSize > 0) { - code = tsdbBuildDeleteSkyline(pIter->pMemDelData, 0, (int32_t)(delSize - 1), pIter->pSkyline); + code = tsdbBuildDeleteSkyline(pInfo->pTombData, 0, (int32_t)(delSize - 1), pIter->pSkyline); } pIter->iSkyline = taosArrayGetSize(pIter->pSkyline) - 1; } -- GitLab