diff --git a/src/backend/distributed/planner/cte_inline.c b/src/backend/distributed/planner/cte_inline.c index 2356ebf48..ce258916d 100644 --- a/src/backend/distributed/planner/cte_inline.c +++ b/src/backend/distributed/planner/cte_inline.c @@ -43,7 +43,7 @@ static bool contain_dml_walker(Node *node, void *context); /* the following utility functions are related to Citus' logic */ static bool RecursivelyInlineCteWalker(Node *node, void *context); static void InlineCTEsInQueryTree(Query *query); -static bool QueryTreeContainsInlinableCteWalker(Node *node); +static bool QueryTreeContainsInlinableCteWalker(Node *node, void *context); /* @@ -135,7 +135,7 @@ InlineCTEsInQueryTree(Query *query) bool QueryTreeContainsInlinableCTE(Query *queryTree) { - return QueryTreeContainsInlinableCteWalker((Node *) queryTree); + return QueryTreeContainsInlinableCteWalker((Node *) queryTree, NULL); } @@ -144,7 +144,7 @@ QueryTreeContainsInlinableCTE(Query *queryTree) * the (sub)queries in the node contains at least one CTE. */ static bool -QueryTreeContainsInlinableCteWalker(Node *node) +QueryTreeContainsInlinableCteWalker(Node *node, void *context) { if (node == NULL) { diff --git a/src/backend/distributed/planner/multi_physical_planner.c b/src/backend/distributed/planner/multi_physical_planner.c index 24fbd9935..8ca51a0a4 100644 --- a/src/backend/distributed/planner/multi_physical_planner.c +++ b/src/backend/distributed/planner/multi_physical_planner.c @@ -234,8 +234,8 @@ static List * FetchEqualityAttrNumsForRTEBoolExpr(BoolExpr *boolExpr); static List * FetchEqualityAttrNumsForList(List *nodeList); static int PartitionColumnIndex(Var *targetVar, List *targetList); static List * GetColumnOriginalIndexes(Oid relationId); -static bool QueryTreeHasImproperForDeparseNodes(Node *inputNode); -static Node * AdjustImproperForDeparseNodes(Node *inputNode); +static bool QueryTreeHasImproperForDeparseNodes(Node *inputNode, void *context); +static Node * AdjustImproperForDeparseNodes(Node *inputNode, void *context); static bool IsImproperForDeparseRelabelTypeNode(Node *inputNode); static bool IsImproperForDeparseCoerceViaIONode(Node *inputNode); static CollateExpr * RelabelTypeToCollateExpr(RelabelType *relabelType); @@ -2698,9 +2698,9 @@ SqlTaskList(Job *job) * the query sublinks, and we don't want to do that unless necessary, as it * would be inefficient. */ - if (QueryTreeHasImproperForDeparseNodes((Node *) jobQuery)) + if (QueryTreeHasImproperForDeparseNodes((Node *) jobQuery, NULL)) { - jobQuery = (Query *) AdjustImproperForDeparseNodes((Node *) jobQuery); + jobQuery = (Query *) AdjustImproperForDeparseNodes((Node *) jobQuery, NULL); } ListCell *fragmentCombinationCell = NULL; @@ -5621,7 +5621,7 @@ TaskListHighestTaskId(List *taskList) * CoerceViaIONodes which are improper for deparse */ static bool -QueryTreeHasImproperForDeparseNodes(Node *inputNode) +QueryTreeHasImproperForDeparseNodes(Node *inputNode, void *context) { if (inputNode == NULL) { @@ -5653,7 +5653,7 @@ QueryTreeHasImproperForDeparseNodes(Node *inputNode) * Details will be written in comments in the corresponding if conditions. */ static Node * -AdjustImproperForDeparseNodes(Node *inputNode) +AdjustImproperForDeparseNodes(Node *inputNode, void *context) { if (inputNode == NULL) { diff --git a/src/backend/distributed/planner/multi_router_planner.c b/src/backend/distributed/planner/multi_router_planner.c index 47769f5bb..cc9d9732c 100644 --- a/src/backend/distributed/planner/multi_router_planner.c +++ b/src/backend/distributed/planner/multi_router_planner.c @@ -154,7 +154,7 @@ static DeferredErrorMessage * DeferErrorIfUnsupportedRouterPlannableSelectQuery( static DeferredErrorMessage * ErrorIfQueryHasUnroutableModifyingCTE(Query *queryTree); #if PG_VERSION_NUM >= PG_VERSION_14 static DeferredErrorMessage * ErrorIfQueryHasCTEWithSearchClause(Query *queryTree); -static bool ContainsSearchClauseWalker(Node *node); +static bool ContainsSearchClauseWalker(Node *node, void *context); #endif static bool SelectsFromDistributedTable(List *rangeTableList, Query *query); static ShardPlacement * CreateDummyPlacement(bool hasLocalRelation); @@ -3929,7 +3929,7 @@ ErrorIfQueryHasUnroutableModifyingCTE(Query *queryTree) static DeferredErrorMessage * ErrorIfQueryHasCTEWithSearchClause(Query *queryTree) { - if (ContainsSearchClauseWalker((Node *) queryTree)) + if (ContainsSearchClauseWalker((Node *) queryTree, NULL)) { return DeferredError(ERRCODE_FEATURE_NOT_SUPPORTED, "CTEs with search clauses are not supported", @@ -3944,7 +3944,7 @@ ErrorIfQueryHasCTEWithSearchClause(Query *queryTree) * CommonTableExprs with search clause */ static bool -ContainsSearchClauseWalker(Node *node) +ContainsSearchClauseWalker(Node *node, void *context) { if (node == NULL) {