From 0d14fa9aad03e07ce7514d822d7e4044baf49db9 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Thu, 25 Aug 2022 16:06:54 +0800 Subject: [PATCH] fix(query): reset the table accesss index. --- source/dnode/vnode/src/tsdb/tsdbRead.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index 55162d4cac..9054db2243 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -2331,7 +2331,10 @@ static int32_t initOrderCheckInfo(SUidOrderCheckInfo* pOrderCheckInfo, SReaderSt uint64_t uid = pOrderCheckInfo->tableUidList[0]; pStatus->pTableIter = taosHashGet(pStatus->pTableMap, &uid, sizeof(uid)); } else { - if (pStatus->pTableIter == NULL) { + if (pStatus->pTableIter == NULL) { // it is the last block of a new file + ASSERT(pOrderCheckInfo->currentIndex == taosHashGetSize(pStatus->pTableMap)); + + pOrderCheckInfo->currentIndex = 0; uint64_t uid = pOrderCheckInfo->tableUidList[pOrderCheckInfo->currentIndex]; pStatus->pTableIter = taosHashGet(pStatus->pTableMap, &uid, sizeof(uid)); }