From be08ccaedcb750e2bf49741e660e9495aeb96eda Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 28 Jun 2022 15:35:51 +0800 Subject: [PATCH] refactor:do internal refactor. --- source/dnode/vnode/src/tsdb/tsdbCacheRead.c | 4 ++-- source/libs/executor/src/executorimpl.c | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c index 3729ba2c6f..80a5939710 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c @@ -47,9 +47,9 @@ int32_t tsdbRetrieveLastRow(void* pVnode, const SArray* pTableIdList, int32_t ty int64_t lastKey = INT64_MIN; bool internalResult = false; for (int32_t i = 0; i < numOfTables; ++i) { - tb_uid_t* uid = taosArrayGet(pTableIdList, i); + STableKeyInfo* pKeyInfo = taosArrayGet(pTableIdList, i); - int32_t code = tsdbCacheGetLastrow(pv->pTsdb->lruCache, *uid, pv->pTsdb, &pRow); + int32_t code = tsdbCacheGetLastrow(pv->pTsdb->lruCache, pKeyInfo->uid, pv->pTsdb, &pRow); if (code != TSDB_CODE_SUCCESS) { return code; } diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 9f154bf7ec..6aabc83ea8 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -4177,6 +4177,17 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo // return NULL; // } + if (pScanNode->tableType == TSDB_SUPER_TABLE) { + int32_t code = vnodeGetAllTableList(pHandle->meta, pScanNode->uid, pTableListInfo->pTableList); + if (code != TSDB_CODE_SUCCESS) { + pTaskInfo->code = terrno; + return NULL; + } + } else { // Create one table group. + STableKeyInfo info = {.lastKey = 0, .uid = pScanNode->uid, .groupId = 0}; + taosArrayPush(pTableListInfo->pTableList, &info); + } + return createLastrowScanOperator(pScanNode, pHandle, pTableListInfo->pTableList, pTaskInfo); } else { ASSERT(0); -- GitLab