Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
HAWQ-1852. Fix find_udf
Browse files Browse the repository at this point in the history
If IsBuildInFunction returns false, then find_udf should return true
directly, which means that the statement contains UDF. Otherwise, it
should continue to recursively determine the args of FuncExpr through
expression_tree_walker, because FuncExpr may contain recursive calls.
For example, suppose "A" is an UDF, then "select A::text" meets this
situation. The outter FuncExpr is "text" and the inner FuncExpr is "A".
  • Loading branch information
ztao1987 committed Dec 19, 2022
1 parent 83b4503 commit eee2d0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/backend/cdb/cdbdatalocality.c
Original file line number Diff line number Diff line change
Expand Up @@ -6142,8 +6142,8 @@ bool udf_collector_walker(Node *node,
if(IsA(node,FuncExpr)){
if(!IsBuildInFunction(((FuncExpr *) node)->funcid)){
context->udf_exist = true;
return true;
}
return false;
}

return expression_tree_walker(node, udf_collector_walker,
Expand Down

0 comments on commit eee2d0d

Please sign in to comment.