From fbb0a1e921dbc12aff0e3abdaae054d603834512 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 22 Nov 2022 11:08:55 +0800 Subject: [PATCH] fix(query): set correct tsdbreader during the creation of tableblockscan info --- source/dnode/vnode/src/tsdb/tsdbRead.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index fbafc63382..69fae4d481 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -329,20 +329,6 @@ static SHashObj* createDataBlockScanInfo(STsdbReader* pTsdbReader, const STableK } taosHashPut(pTableMap, &pScanInfo->uid, sizeof(uint64_t), &pScanInfo, POINTER_BYTES); - -#if 0 -// STableBlockScanInfo info = {.lastKey = 0, .uid = idList[j].uid}; - if (ASCENDING_TRAVERSE(pTsdbReader->order)) { - int64_t skey = pTsdbReader->window.skey; - info.lastKey = (skey > INT64_MIN) ? (skey - 1) : skey; - } else { - int64_t ekey = pTsdbReader->window.ekey; - info.lastKey = (ekey < INT64_MAX) ? (ekey + 1) : ekey; - } - - taosHashPut(pTableMap, &info.uid, sizeof(uint64_t), &info, sizeof(info)); -#endif - tsdbTrace("%p check table uid:%" PRId64 " from lastKey:%" PRId64 " %s", pTsdbReader, pScanInfo->uid, pScanInfo->lastKey, pTsdbReader->idStr); } @@ -3798,7 +3784,8 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, void* pTableL updateBlockSMAInfo(pReader->pSchema, &pReader->suppInfo); } - pReader->status.pTableMap = createDataBlockScanInfo(pReader, pTableList, numOfTables); + STsdbReader* p = (pReader->innerReader[0] != NULL)? pReader->innerReader[0]:pReader; + pReader->status.pTableMap = createDataBlockScanInfo(p, pTableList, numOfTables); if (pReader->status.pTableMap == NULL) { tsdbReaderClose(pReader); *ppReader = NULL; -- GitLab