From 2ad70dff1e9487297dcb6d15f8bf46f7a8019aba Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Fri, 12 Aug 2022 17:08:32 +0800 Subject: [PATCH] fix: output datablcok desc error --- source/libs/planner/src/planPhysiCreater.c | 2 +- source/libs/planner/test/planIntervalTest.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/source/libs/planner/src/planPhysiCreater.c b/source/libs/planner/src/planPhysiCreater.c index 5381db3ba7..c7eb6f7b5e 100644 --- a/source/libs/planner/src/planPhysiCreater.c +++ b/source/libs/planner/src/planPhysiCreater.c @@ -195,7 +195,7 @@ static int32_t addDataBlockSlotsImpl(SPhysiPlanContext* pCxt, SNodeList* pList, int32_t code = TSDB_CODE_SUCCESS; SHashObj* pHash = taosArrayGetP(pCxt->pLocationHelper, pDataBlockDesc->dataBlockId); - int16_t nextSlotId = taosHashGetSize(pHash), slotId = 0; + int16_t nextSlotId = LIST_LENGTH(pDataBlockDesc->pSlots), slotId = 0; SNode* pNode = NULL; FOREACH(pNode, pList) { SNode* pExpr = QUERY_NODE_ORDER_BY_EXPR == nodeType(pNode) ? ((SOrderByExprNode*)pNode)->pExpr : pNode; diff --git a/source/libs/planner/test/planIntervalTest.cpp b/source/libs/planner/test/planIntervalTest.cpp index 674603310a..8346889734 100644 --- a/source/libs/planner/test/planIntervalTest.cpp +++ b/source/libs/planner/test/planIntervalTest.cpp @@ -48,6 +48,9 @@ TEST_F(PlanIntervalTest, fill) { run("SELECT _WSTART, TBNAME, COUNT(*) FROM st1 " "WHERE ts > '2022-04-01 00:00:00' and ts < '2022-04-30 23:59:59' " "PARTITION BY TBNAME INTERVAL(10s) FILL(PREV)"); + + run("SELECT COUNT(c1), MAX(c3), COUNT(c1) FROM t1 " + "WHERE ts > '2022-04-01 00:00:00' and ts < '2022-04-30 23:59:59' INTERVAL(10s) FILL(PREV)"); } TEST_F(PlanIntervalTest, selectFunc) { -- GitLab