From c277abd3bfc38a9e6ab273baa9187cceae7b2a5f Mon Sep 17 00:00:00 2001 From: facetosea <25808407@qq.com> Date: Sun, 14 Jan 2024 21:47:13 +0800 Subject: [PATCH] fix: functionNode skip --- source/libs/nodes/src/nodesUtilFuncs.c | 5 ----- source/libs/parser/src/parTranslater.c | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index 1f641410d9..446b29d7f2 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -2170,9 +2170,6 @@ int32_t nodesCollectSelectFuncs(SSelectStmt* pSelect, ESqlClause clause, char* t .classifier = classifier, .tableAlias = tableAlias, .pFuncs = pFuncs}; - if (NULL == cxt.pFuncs) { - return TSDB_CODE_OUT_OF_MEMORY; - } nodesWalkSelectStmt(pSelect, clause, collectFuncs, &cxt); return cxt.errCode; @@ -2197,11 +2194,9 @@ int32_t nodesCollectFuncs(SSelectStmt* pSelect, ESqlClause clause, char* tableAl *pFuncs = cxt.pFuncs; } else { nodesDestroyList(cxt.pFuncs); - *pFuncs = NULL; } } else { nodesDestroyList(cxt.pFuncs); - *pFuncs = NULL; } return cxt.errCode; diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 988c2442e0..b14efcd40b 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -4526,7 +4526,7 @@ static EDealRes replaceOrderByAliasImpl(SNode** pNode, void* pContext) { SReplaceOrderByAliasCxt* pCxt = pContext; SNodeList* pProjectionList = pCxt->pProjectionList; SNode* pProject = NULL; - if (QUERY_NODE_COLUMN == nodeType(*pNode) || QUERY_NODE_FUNCTION == nodeType(*pNode)) { + if (QUERY_NODE_COLUMN == nodeType(*pNode)) { FOREACH(pProject, pProjectionList) { SExprNode* pExpr = (SExprNode*)pProject; if (0 == strcmp(((SColumnRefNode*)*pNode)->colName, pExpr->userAlias)