From d63eee8b49d848ee8f048753aab478484c4e3b6b Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Tue, 25 Oct 2022 19:00:46 +0800 Subject: [PATCH] fix: alter table check --- source/libs/planner/src/planOptimizer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index 1cfdb543db..9c9a7cfebb 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -2285,6 +2285,7 @@ static int32_t lastRowScanOptimize(SOptimizeContext* pCxt, SLogicSubplan* pLogic } if (FUNCTION_TYPE_LAST == funcType) { nodesWalkExpr(nodesListGetNode(pFunc->pParameterList, 0), lastRowScanOptSetColDataType, &cxt); + nodesListErase(pFunc->pParameterList, nodesListGetCell(pFunc->pParameterList, 1)); } } } @@ -2294,7 +2295,7 @@ static int32_t lastRowScanOptimize(SOptimizeContext* pCxt, SLogicSubplan* pLogic pScan->igLastNull = pAgg->hasLast ? true : false; if (NULL != cxt.pLastCols) { cxt.doAgg = false; - nodesWalkExprs(pScan->pScanCols, lastRowScanOptSetColDataType, &cxt); + lastRowScanOptSetLastTargets(pScan->pScanCols, cxt.pLastCols); nodesWalkExprs(pScan->pScanPseudoCols, lastRowScanOptSetColDataType, &cxt); lastRowScanOptSetLastTargets(pScan->node.pTargets, cxt.pLastCols); nodesClearList(cxt.pLastCols); -- GitLab