fix: functionNode skip

This commit is contained in:
facetosea 2024-01-14 21:47:13 +08:00
parent ab02ec74c9
commit c277abd3bf
2 changed files with 1 additions and 6 deletions

View File

@ -2170,9 +2170,6 @@ int32_t nodesCollectSelectFuncs(SSelectStmt* pSelect, ESqlClause clause, char* t
.classifier = classifier, .classifier = classifier,
.tableAlias = tableAlias, .tableAlias = tableAlias,
.pFuncs = pFuncs}; .pFuncs = pFuncs};
if (NULL == cxt.pFuncs) {
return TSDB_CODE_OUT_OF_MEMORY;
}
nodesWalkSelectStmt(pSelect, clause, collectFuncs, &cxt); nodesWalkSelectStmt(pSelect, clause, collectFuncs, &cxt);
return cxt.errCode; return cxt.errCode;
@ -2197,11 +2194,9 @@ int32_t nodesCollectFuncs(SSelectStmt* pSelect, ESqlClause clause, char* tableAl
*pFuncs = cxt.pFuncs; *pFuncs = cxt.pFuncs;
} else { } else {
nodesDestroyList(cxt.pFuncs); nodesDestroyList(cxt.pFuncs);
*pFuncs = NULL;
} }
} else { } else {
nodesDestroyList(cxt.pFuncs); nodesDestroyList(cxt.pFuncs);
*pFuncs = NULL;
} }
return cxt.errCode; return cxt.errCode;

View File

@ -4526,7 +4526,7 @@ static EDealRes replaceOrderByAliasImpl(SNode** pNode, void* pContext) {
SReplaceOrderByAliasCxt* pCxt = pContext; SReplaceOrderByAliasCxt* pCxt = pContext;
SNodeList* pProjectionList = pCxt->pProjectionList; SNodeList* pProjectionList = pCxt->pProjectionList;
SNode* pProject = NULL; SNode* pProject = NULL;
if (QUERY_NODE_COLUMN == nodeType(*pNode) || QUERY_NODE_FUNCTION == nodeType(*pNode)) { if (QUERY_NODE_COLUMN == nodeType(*pNode)) {
FOREACH(pProject, pProjectionList) { FOREACH(pProject, pProjectionList) {
SExprNode* pExpr = (SExprNode*)pProject; SExprNode* pExpr = (SExprNode*)pProject;
if (0 == strcmp(((SColumnRefNode*)*pNode)->colName, pExpr->userAlias) if (0 == strcmp(((SColumnRefNode*)*pNode)->colName, pExpr->userAlias)