mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
Remove useless casts to (void *)
Many of them just seem to have been copied around for no real reason. Their presence causes (small) risks of hiding actual type mismatches or silently discarding qualifiers Discussion: https://www.postgresql.org/message-id/flat/461ea37c-8b58-43b4-9736-52884e862820@eisentraut.org
This commit is contained in:
@ -99,7 +99,7 @@ geqo(PlannerInfo *root, int number_of_rels, List *initial_rels)
|
||||
#endif
|
||||
|
||||
/* set up private information */
|
||||
root->join_search_private = (void *) &private;
|
||||
root->join_search_private = &private;
|
||||
private.initial_rels = initial_rels;
|
||||
|
||||
/* initialize private number generator */
|
||||
|
@ -5029,8 +5029,7 @@ cost_qual_eval_walker(Node *node, cost_qual_eval_context *context)
|
||||
}
|
||||
|
||||
/* recurse into children */
|
||||
return expression_tree_walker(node, cost_qual_eval_walker,
|
||||
(void *) context);
|
||||
return expression_tree_walker(node, cost_qual_eval_walker, context);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2463,7 +2463,7 @@ match_eclass_clauses_to_index(PlannerInfo *root, IndexOptInfo *index,
|
||||
clauses = generate_implied_equalities_for_column(root,
|
||||
index->rel,
|
||||
ec_member_matches_indexcol,
|
||||
(void *) &arg,
|
||||
&arg,
|
||||
index->rel->lateral_referencers);
|
||||
|
||||
/*
|
||||
|
@ -5037,9 +5037,7 @@ replace_nestloop_params_mutator(Node *node, PlannerInfo *root)
|
||||
/* Replace the PlaceHolderVar with a nestloop Param */
|
||||
return (Node *) replace_nestloop_param_placeholdervar(root, phv);
|
||||
}
|
||||
return expression_tree_mutator(node,
|
||||
replace_nestloop_params_mutator,
|
||||
(void *) root);
|
||||
return expression_tree_mutator(node, replace_nestloop_params_mutator, root);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -485,7 +485,7 @@ flatten_unplanned_rtes(PlannerGlobal *glob, RangeTblEntry *rte)
|
||||
/* Use query_tree_walker to find all RTEs in the parse tree */
|
||||
(void) query_tree_walker(rte->subquery,
|
||||
flatten_rtes_walker,
|
||||
(void *) &cxt,
|
||||
&cxt,
|
||||
QTW_EXAMINE_RTES_BEFORE);
|
||||
}
|
||||
|
||||
@ -516,13 +516,12 @@ flatten_rtes_walker(Node *node, flatten_rtes_walker_context *cxt)
|
||||
cxt->query = (Query *) node;
|
||||
result = query_tree_walker((Query *) node,
|
||||
flatten_rtes_walker,
|
||||
(void *) cxt,
|
||||
cxt,
|
||||
QTW_EXAMINE_RTES_BEFORE);
|
||||
cxt->query = save_query;
|
||||
return result;
|
||||
}
|
||||
return expression_tree_walker(node, flatten_rtes_walker,
|
||||
(void *) cxt);
|
||||
return expression_tree_walker(node, flatten_rtes_walker, cxt);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2243,8 +2242,7 @@ fix_scan_expr_mutator(Node *node, fix_scan_expr_context *context)
|
||||
context->num_exec),
|
||||
context);
|
||||
fix_expr_common(context->root, node);
|
||||
return expression_tree_mutator(node, fix_scan_expr_mutator,
|
||||
(void *) context);
|
||||
return expression_tree_mutator(node, fix_scan_expr_mutator, context);
|
||||
}
|
||||
|
||||
static bool
|
||||
@ -2256,8 +2254,7 @@ fix_scan_expr_walker(Node *node, fix_scan_expr_context *context)
|
||||
Assert(!IsA(node, PlaceHolderVar));
|
||||
Assert(!IsA(node, AlternativeSubPlan));
|
||||
fix_expr_common(context->root, node);
|
||||
return expression_tree_walker(node, fix_scan_expr_walker,
|
||||
(void *) context);
|
||||
return expression_tree_walker(node, fix_scan_expr_walker, context);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2612,8 +2609,7 @@ convert_combining_aggrefs(Node *node, void *context)
|
||||
|
||||
return (Node *) parent_agg;
|
||||
}
|
||||
return expression_tree_mutator(node, convert_combining_aggrefs,
|
||||
(void *) context);
|
||||
return expression_tree_mutator(node, convert_combining_aggrefs, context);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -3165,9 +3161,7 @@ fix_join_expr_mutator(Node *node, fix_join_expr_context *context)
|
||||
context->num_exec),
|
||||
context);
|
||||
fix_expr_common(context->root, node);
|
||||
return expression_tree_mutator(node,
|
||||
fix_join_expr_mutator,
|
||||
(void *) context);
|
||||
return expression_tree_mutator(node, fix_join_expr_mutator, context);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -3292,9 +3286,7 @@ fix_upper_expr_mutator(Node *node, fix_upper_expr_context *context)
|
||||
context->num_exec),
|
||||
context);
|
||||
fix_expr_common(context->root, node);
|
||||
return expression_tree_mutator(node,
|
||||
fix_upper_expr_mutator,
|
||||
(void *) context);
|
||||
return expression_tree_mutator(node, fix_upper_expr_mutator, context);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -3390,7 +3382,7 @@ fix_windowagg_condition_expr_mutator(Node *node,
|
||||
|
||||
return expression_tree_mutator(node,
|
||||
fix_windowagg_condition_expr_mutator,
|
||||
(void *) context);
|
||||
context);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -3656,10 +3648,10 @@ extract_query_dependencies_walker(Node *node, PlannerInfo *context)
|
||||
|
||||
/* And recurse into the query's subexpressions */
|
||||
return query_tree_walker(query, extract_query_dependencies_walker,
|
||||
(void *) context, 0);
|
||||
context, 0);
|
||||
}
|
||||
/* Extract function dependencies and check for regclass Consts */
|
||||
fix_expr_common(context, node);
|
||||
return expression_tree_walker(node, extract_query_dependencies_walker,
|
||||
(void *) context);
|
||||
context);
|
||||
}
|
||||
|
@ -697,9 +697,7 @@ convert_testexpr_mutator(Node *node,
|
||||
*/
|
||||
return node;
|
||||
}
|
||||
return expression_tree_mutator(node,
|
||||
convert_testexpr_mutator,
|
||||
(void *) context);
|
||||
return expression_tree_mutator(node, convert_testexpr_mutator, context);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1121,14 +1119,13 @@ contain_outer_selfref_walker(Node *node, Index *depth)
|
||||
(*depth)++;
|
||||
|
||||
result = query_tree_walker(query, contain_outer_selfref_walker,
|
||||
(void *) depth, QTW_EXAMINE_RTES_BEFORE);
|
||||
depth, QTW_EXAMINE_RTES_BEFORE);
|
||||
|
||||
(*depth)--;
|
||||
|
||||
return result;
|
||||
}
|
||||
return expression_tree_walker(node, contain_outer_selfref_walker,
|
||||
(void *) depth);
|
||||
return expression_tree_walker(node, contain_outer_selfref_walker, depth);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1927,9 +1924,7 @@ replace_correlation_vars_mutator(Node *node, PlannerInfo *root)
|
||||
return (Node *) replace_outer_merge_support(root,
|
||||
(MergeSupportFunc *) node);
|
||||
}
|
||||
return expression_tree_mutator(node,
|
||||
replace_correlation_vars_mutator,
|
||||
(void *) root);
|
||||
return expression_tree_mutator(node, replace_correlation_vars_mutator, root);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2077,7 +2072,7 @@ process_sublinks_mutator(Node *node, process_sublinks_context *context)
|
||||
|
||||
return expression_tree_mutator(node,
|
||||
process_sublinks_mutator,
|
||||
(void *) &locContext);
|
||||
&locContext);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2985,8 +2980,7 @@ finalize_primnode(Node *node, finalize_primnode_context *context)
|
||||
|
||||
return false; /* no more to do here */
|
||||
}
|
||||
return expression_tree_walker(node, finalize_primnode,
|
||||
(void *) context);
|
||||
return expression_tree_walker(node, finalize_primnode, context);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -3008,8 +3002,7 @@ finalize_agg_primnode(Node *node, finalize_primnode_context *context)
|
||||
finalize_primnode((Node *) agg->aggfilter, context);
|
||||
return false; /* there can't be any Aggrefs below here */
|
||||
}
|
||||
return expression_tree_walker(node, finalize_agg_primnode,
|
||||
(void *) context);
|
||||
return expression_tree_walker(node, finalize_agg_primnode, context);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -359,8 +359,7 @@ preprocess_aggrefs_walker(Node *node, PlannerInfo *root)
|
||||
return false;
|
||||
}
|
||||
Assert(!IsA(node, SubLink));
|
||||
return expression_tree_walker(node, preprocess_aggrefs_walker,
|
||||
(void *) root);
|
||||
return expression_tree_walker(node, preprocess_aggrefs_walker, root);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2450,7 +2450,7 @@ pullup_replace_vars(Node *expr, pullup_replace_vars_context *context)
|
||||
return replace_rte_variables(expr,
|
||||
context->varno, 0,
|
||||
pullup_replace_vars_callback,
|
||||
(void *) context,
|
||||
context,
|
||||
context->outer_hasSubLinks);
|
||||
}
|
||||
|
||||
@ -2707,7 +2707,7 @@ pullup_replace_vars_subquery(Query *query,
|
||||
return (Query *) replace_rte_variables((Node *) query,
|
||||
context->varno, 1,
|
||||
pullup_replace_vars_callback,
|
||||
(void *) context,
|
||||
context,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@ -3775,7 +3775,7 @@ find_dependent_phvs_walker(Node *node,
|
||||
context->sublevels_up++;
|
||||
result = query_tree_walker((Query *) node,
|
||||
find_dependent_phvs_walker,
|
||||
(void *) context, 0);
|
||||
context, 0);
|
||||
context->sublevels_up--;
|
||||
return result;
|
||||
}
|
||||
@ -3784,8 +3784,7 @@ find_dependent_phvs_walker(Node *node,
|
||||
Assert(!IsA(node, PlaceHolderInfo));
|
||||
Assert(!IsA(node, MinMaxAggInfo));
|
||||
|
||||
return expression_tree_walker(node, find_dependent_phvs_walker,
|
||||
(void *) context);
|
||||
return expression_tree_walker(node, find_dependent_phvs_walker, context);
|
||||
}
|
||||
|
||||
static bool
|
||||
@ -3800,15 +3799,12 @@ find_dependent_phvs(PlannerInfo *root, int varno)
|
||||
context.relids = bms_make_singleton(varno);
|
||||
context.sublevels_up = 0;
|
||||
|
||||
if (query_tree_walker(root->parse,
|
||||
find_dependent_phvs_walker,
|
||||
(void *) &context,
|
||||
0))
|
||||
if (query_tree_walker(root->parse, find_dependent_phvs_walker, &context, 0))
|
||||
return true;
|
||||
/* The append_rel_list could be populated already, so check it too */
|
||||
if (expression_tree_walker((Node *) root->append_rel_list,
|
||||
find_dependent_phvs_walker,
|
||||
(void *) &context))
|
||||
&context))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@ -3847,10 +3843,7 @@ find_dependent_phvs_in_jointree(PlannerInfo *root, Node *node, int varno)
|
||||
RangeTblEntry *rte = rt_fetch(relid, root->parse->rtable);
|
||||
|
||||
if (rte->lateral &&
|
||||
range_table_entry_walker(rte,
|
||||
find_dependent_phvs_walker,
|
||||
(void *) &context,
|
||||
0))
|
||||
range_table_entry_walker(rte, find_dependent_phvs_walker, &context, 0))
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -3907,7 +3900,7 @@ substitute_phv_relids_walker(Node *node,
|
||||
context->sublevels_up++;
|
||||
result = query_tree_walker((Query *) node,
|
||||
substitute_phv_relids_walker,
|
||||
(void *) context, 0);
|
||||
context, 0);
|
||||
context->sublevels_up--;
|
||||
return result;
|
||||
}
|
||||
@ -3917,8 +3910,7 @@ substitute_phv_relids_walker(Node *node,
|
||||
Assert(!IsA(node, PlaceHolderInfo));
|
||||
Assert(!IsA(node, MinMaxAggInfo));
|
||||
|
||||
return expression_tree_walker(node, substitute_phv_relids_walker,
|
||||
(void *) context);
|
||||
return expression_tree_walker(node, substitute_phv_relids_walker, context);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -3935,7 +3927,7 @@ substitute_phv_relids(Node *node, int varno, Relids subrelids)
|
||||
*/
|
||||
query_or_expression_tree_walker(node,
|
||||
substitute_phv_relids_walker,
|
||||
(void *) &context,
|
||||
&context,
|
||||
0);
|
||||
}
|
||||
|
||||
|
@ -425,7 +425,7 @@ adjust_appendrel_attrs_mutator(Node *node,
|
||||
|
||||
phv = (PlaceHolderVar *) expression_tree_mutator(node,
|
||||
adjust_appendrel_attrs_mutator,
|
||||
(void *) context);
|
||||
context);
|
||||
/* now fix PlaceHolderVar's relid sets */
|
||||
if (phv->phlevelsup == 0)
|
||||
{
|
||||
@ -509,8 +509,7 @@ adjust_appendrel_attrs_mutator(Node *node,
|
||||
Assert(!IsA(node, RangeTblRef));
|
||||
Assert(!IsA(node, JoinExpr));
|
||||
|
||||
return expression_tree_mutator(node, adjust_appendrel_attrs_mutator,
|
||||
(void *) context);
|
||||
return expression_tree_mutator(node, adjust_appendrel_attrs_mutator, context);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -265,8 +265,7 @@ find_window_functions_walker(Node *node, WindowFuncLists *lists)
|
||||
return false;
|
||||
}
|
||||
Assert(!IsA(node, SubLink));
|
||||
return expression_tree_walker(node, find_window_functions_walker,
|
||||
(void *) lists);
|
||||
return expression_tree_walker(node, find_window_functions_walker, lists);
|
||||
}
|
||||
|
||||
|
||||
@ -1217,7 +1216,7 @@ contain_context_dependent_node_walker(Node *node, int *flags)
|
||||
*flags |= CCDN_CASETESTEXPR_OK;
|
||||
res = expression_tree_walker(node,
|
||||
contain_context_dependent_node_walker,
|
||||
(void *) flags);
|
||||
flags);
|
||||
*flags = save_flags;
|
||||
return res;
|
||||
}
|
||||
@ -1241,7 +1240,7 @@ contain_context_dependent_node_walker(Node *node, int *flags)
|
||||
return res;
|
||||
}
|
||||
return expression_tree_walker(node, contain_context_dependent_node_walker,
|
||||
(void *) flags);
|
||||
flags);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@ -2416,7 +2415,7 @@ estimate_expression_value(PlannerInfo *root, Node *node)
|
||||
*/
|
||||
#define ece_generic_processing(node) \
|
||||
expression_tree_mutator((Node *) (node), eval_const_expressions_mutator, \
|
||||
(void *) context)
|
||||
context)
|
||||
|
||||
/*
|
||||
* Check whether all arguments of the given node were reduced to Consts.
|
||||
@ -2552,7 +2551,7 @@ eval_const_expressions_mutator(Node *node,
|
||||
args = (List *)
|
||||
expression_tree_mutator((Node *) args,
|
||||
eval_const_expressions_mutator,
|
||||
(void *) context);
|
||||
context);
|
||||
/* ... and the filter expression, which isn't */
|
||||
aggfilter = (Expr *)
|
||||
eval_const_expressions_mutator((Node *) expr->aggfilter,
|
||||
@ -2697,7 +2696,7 @@ eval_const_expressions_mutator(Node *node,
|
||||
*/
|
||||
args = (List *) expression_tree_mutator((Node *) expr->args,
|
||||
eval_const_expressions_mutator,
|
||||
(void *) context);
|
||||
context);
|
||||
|
||||
/*
|
||||
* We must do our own check for NULLs because DistinctExpr has
|
||||
@ -4094,7 +4093,7 @@ simplify_function(Oid funcid, Oid result_type, int32 result_typmod,
|
||||
args = expand_function_arguments(args, false, result_type, func_tuple);
|
||||
args = (List *) expression_tree_mutator((Node *) args,
|
||||
eval_const_expressions_mutator,
|
||||
(void *) context);
|
||||
context);
|
||||
/* Argument processing done, give it back to the caller */
|
||||
*args_p = args;
|
||||
}
|
||||
@ -4636,7 +4635,7 @@ inline_function(Oid funcid, Oid result_type, Oid result_collid,
|
||||
callback_arg.prosrc = src;
|
||||
|
||||
sqlerrcontext.callback = sql_inline_error_callback;
|
||||
sqlerrcontext.arg = (void *) &callback_arg;
|
||||
sqlerrcontext.arg = &callback_arg;
|
||||
sqlerrcontext.previous = error_context_stack;
|
||||
error_context_stack = &sqlerrcontext;
|
||||
|
||||
@ -4938,8 +4937,7 @@ substitute_actual_parameters_mutator(Node *node,
|
||||
/* We don't need to copy at this time (it'll get done later) */
|
||||
return list_nth(context->args, param->paramid - 1);
|
||||
}
|
||||
return expression_tree_mutator(node, substitute_actual_parameters_mutator,
|
||||
(void *) context);
|
||||
return expression_tree_mutator(node, substitute_actual_parameters_mutator, context);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -5190,7 +5188,7 @@ inline_set_returning_function(PlannerInfo *root, RangeTblEntry *rte)
|
||||
callback_arg.prosrc = src;
|
||||
|
||||
sqlerrcontext.callback = sql_inline_error_callback;
|
||||
sqlerrcontext.arg = (void *) &callback_arg;
|
||||
sqlerrcontext.arg = &callback_arg;
|
||||
sqlerrcontext.previous = error_context_stack;
|
||||
error_context_stack = &sqlerrcontext;
|
||||
|
||||
@ -5382,7 +5380,7 @@ substitute_actual_srf_parameters_mutator(Node *node,
|
||||
context->sublevels_up++;
|
||||
result = (Node *) query_tree_mutator((Query *) node,
|
||||
substitute_actual_srf_parameters_mutator,
|
||||
(void *) context,
|
||||
context,
|
||||
0);
|
||||
context->sublevels_up--;
|
||||
return result;
|
||||
@ -5407,7 +5405,7 @@ substitute_actual_srf_parameters_mutator(Node *node,
|
||||
}
|
||||
return expression_tree_mutator(node,
|
||||
substitute_actual_srf_parameters_mutator,
|
||||
(void *) context);
|
||||
context);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -5436,6 +5434,5 @@ pull_paramids_walker(Node *node, Bitmapset **context)
|
||||
*context = bms_add_member(*context, param->paramid);
|
||||
return false;
|
||||
}
|
||||
return expression_tree_walker(node, pull_paramids_walker,
|
||||
(void *) context);
|
||||
return expression_tree_walker(node, pull_paramids_walker, context);
|
||||
}
|
||||
|
@ -908,7 +908,7 @@ static void
|
||||
list_startup_fn(Node *clause, PredIterInfo info)
|
||||
{
|
||||
info->state_list = (List *) clause;
|
||||
info->state = (void *) list_head(info->state_list);
|
||||
info->state = list_head(info->state_list);
|
||||
}
|
||||
|
||||
static Node *
|
||||
@ -920,7 +920,7 @@ list_next_fn(PredIterInfo info)
|
||||
if (l == NULL)
|
||||
return NULL;
|
||||
n = lfirst(l);
|
||||
info->state = (void *) lnext(info->state_list, l);
|
||||
info->state = lnext(info->state_list, l);
|
||||
return n;
|
||||
}
|
||||
|
||||
@ -938,7 +938,7 @@ static void
|
||||
boolexpr_startup_fn(Node *clause, PredIterInfo info)
|
||||
{
|
||||
info->state_list = ((BoolExpr *) clause)->args;
|
||||
info->state = (void *) list_head(info->state_list);
|
||||
info->state = list_head(info->state_list);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -968,7 +968,7 @@ arrayconst_startup_fn(Node *clause, PredIterInfo info)
|
||||
|
||||
/* Create working state struct */
|
||||
state = (ArrayConstIterState *) palloc(sizeof(ArrayConstIterState));
|
||||
info->state = (void *) state;
|
||||
info->state = state;
|
||||
|
||||
/* Deconstruct the array literal */
|
||||
arrayconst = (Const *) lsecond(saop->args);
|
||||
@ -1047,7 +1047,7 @@ arrayexpr_startup_fn(Node *clause, PredIterInfo info)
|
||||
|
||||
/* Create working state struct */
|
||||
state = (ArrayExprIterState *) palloc(sizeof(ArrayExprIterState));
|
||||
info->state = (void *) state;
|
||||
info->state = state;
|
||||
|
||||
/* Set up a dummy OpExpr to return as the per-item node */
|
||||
state->opexpr.xpr.type = T_OpExpr;
|
||||
|
@ -1139,8 +1139,7 @@ split_pathtarget_walker(Node *node, split_pathtarget_context *context)
|
||||
context->current_depth = 0;
|
||||
context->current_sgref = 0; /* subexpressions are not sortgroup items */
|
||||
|
||||
(void) expression_tree_walker(node, split_pathtarget_walker,
|
||||
(void *) context);
|
||||
(void) expression_tree_walker(node, split_pathtarget_walker, context);
|
||||
|
||||
/* Depth is one more than any SRF below it */
|
||||
srf_depth = context->current_depth + 1;
|
||||
@ -1181,8 +1180,7 @@ split_pathtarget_walker(Node *node, split_pathtarget_context *context)
|
||||
* examine its inputs.
|
||||
*/
|
||||
context->current_sgref = 0; /* subexpressions are not sortgroup items */
|
||||
return expression_tree_walker(node, split_pathtarget_walker,
|
||||
(void *) context);
|
||||
return expression_tree_walker(node, split_pathtarget_walker, context);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -124,7 +124,7 @@ pull_varnos(PlannerInfo *root, Node *node)
|
||||
*/
|
||||
query_or_expression_tree_walker(node,
|
||||
pull_varnos_walker,
|
||||
(void *) &context,
|
||||
&context,
|
||||
0);
|
||||
|
||||
return context.varnos;
|
||||
@ -150,7 +150,7 @@ pull_varnos_of_level(PlannerInfo *root, Node *node, int levelsup)
|
||||
*/
|
||||
query_or_expression_tree_walker(node,
|
||||
pull_varnos_walker,
|
||||
(void *) &context,
|
||||
&context,
|
||||
0);
|
||||
|
||||
return context.varnos;
|
||||
@ -269,12 +269,11 @@ pull_varnos_walker(Node *node, pull_varnos_context *context)
|
||||
|
||||
context->sublevels_up++;
|
||||
result = query_tree_walker((Query *) node, pull_varnos_walker,
|
||||
(void *) context, 0);
|
||||
context, 0);
|
||||
context->sublevels_up--;
|
||||
return result;
|
||||
}
|
||||
return expression_tree_walker(node, pull_varnos_walker,
|
||||
(void *) context);
|
||||
return expression_tree_walker(node, pull_varnos_walker, context);
|
||||
}
|
||||
|
||||
|
||||
@ -324,8 +323,7 @@ pull_varattnos_walker(Node *node, pull_varattnos_context *context)
|
||||
/* Should not find an unplanned subquery */
|
||||
Assert(!IsA(node, Query));
|
||||
|
||||
return expression_tree_walker(node, pull_varattnos_walker,
|
||||
(void *) context);
|
||||
return expression_tree_walker(node, pull_varattnos_walker, context);
|
||||
}
|
||||
|
||||
|
||||
@ -350,7 +348,7 @@ pull_vars_of_level(Node *node, int levelsup)
|
||||
*/
|
||||
query_or_expression_tree_walker(node,
|
||||
pull_vars_walker,
|
||||
(void *) &context,
|
||||
&context,
|
||||
0);
|
||||
|
||||
return context.vars;
|
||||
@ -385,12 +383,11 @@ pull_vars_walker(Node *node, pull_vars_context *context)
|
||||
|
||||
context->sublevels_up++;
|
||||
result = query_tree_walker((Query *) node, pull_vars_walker,
|
||||
(void *) context, 0);
|
||||
context, 0);
|
||||
context->sublevels_up--;
|
||||
return result;
|
||||
}
|
||||
return expression_tree_walker(node, pull_vars_walker,
|
||||
(void *) context);
|
||||
return expression_tree_walker(node, pull_vars_walker, context);
|
||||
}
|
||||
|
||||
|
||||
@ -449,7 +446,7 @@ contain_vars_of_level(Node *node, int levelsup)
|
||||
|
||||
return query_or_expression_tree_walker(node,
|
||||
contain_vars_of_level_walker,
|
||||
(void *) &sublevels_up,
|
||||
&sublevels_up,
|
||||
0);
|
||||
}
|
||||
|
||||
@ -484,14 +481,14 @@ contain_vars_of_level_walker(Node *node, int *sublevels_up)
|
||||
(*sublevels_up)++;
|
||||
result = query_tree_walker((Query *) node,
|
||||
contain_vars_of_level_walker,
|
||||
(void *) sublevels_up,
|
||||
sublevels_up,
|
||||
0);
|
||||
(*sublevels_up)--;
|
||||
return result;
|
||||
}
|
||||
return expression_tree_walker(node,
|
||||
contain_vars_of_level_walker,
|
||||
(void *) sublevels_up);
|
||||
sublevels_up);
|
||||
}
|
||||
|
||||
|
||||
@ -520,7 +517,7 @@ locate_var_of_level(Node *node, int levelsup)
|
||||
|
||||
(void) query_or_expression_tree_walker(node,
|
||||
locate_var_of_level_walker,
|
||||
(void *) &context,
|
||||
&context,
|
||||
0);
|
||||
|
||||
return context.var_location;
|
||||
@ -558,14 +555,14 @@ locate_var_of_level_walker(Node *node,
|
||||
context->sublevels_up++;
|
||||
result = query_tree_walker((Query *) node,
|
||||
locate_var_of_level_walker,
|
||||
(void *) context,
|
||||
context,
|
||||
0);
|
||||
context->sublevels_up--;
|
||||
return result;
|
||||
}
|
||||
return expression_tree_walker(node,
|
||||
locate_var_of_level_walker,
|
||||
(void *) context);
|
||||
context);
|
||||
}
|
||||
|
||||
|
||||
@ -707,8 +704,7 @@ pull_var_clause_walker(Node *node, pull_var_clause_context *context)
|
||||
else
|
||||
elog(ERROR, "PlaceHolderVar found where not expected");
|
||||
}
|
||||
return expression_tree_walker(node, pull_var_clause_walker,
|
||||
(void *) context);
|
||||
return expression_tree_walker(node, pull_var_clause_walker, context);
|
||||
}
|
||||
|
||||
|
||||
@ -867,7 +863,7 @@ flatten_join_alias_vars_mutator(Node *node,
|
||||
|
||||
phv = (PlaceHolderVar *) expression_tree_mutator(node,
|
||||
flatten_join_alias_vars_mutator,
|
||||
(void *) context);
|
||||
context);
|
||||
/* now fix PlaceHolderVar's relid sets */
|
||||
if (phv->phlevelsup == context->sublevels_up)
|
||||
{
|
||||
@ -889,7 +885,7 @@ flatten_join_alias_vars_mutator(Node *node,
|
||||
context->inserted_sublink = ((Query *) node)->hasSubLinks;
|
||||
newnode = query_tree_mutator((Query *) node,
|
||||
flatten_join_alias_vars_mutator,
|
||||
(void *) context,
|
||||
context,
|
||||
QTW_IGNORE_JOINALIASES);
|
||||
newnode->hasSubLinks |= context->inserted_sublink;
|
||||
context->inserted_sublink = save_inserted_sublink;
|
||||
@ -904,8 +900,7 @@ flatten_join_alias_vars_mutator(Node *node,
|
||||
Assert(!IsA(node, PlaceHolderInfo));
|
||||
Assert(!IsA(node, MinMaxAggInfo));
|
||||
|
||||
return expression_tree_mutator(node, flatten_join_alias_vars_mutator,
|
||||
(void *) context);
|
||||
return expression_tree_mutator(node, flatten_join_alias_vars_mutator, context);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1044,7 +1039,7 @@ flatten_group_exprs_mutator(Node *node,
|
||||
context->inserted_sublink = ((Query *) node)->hasSubLinks;
|
||||
newnode = query_tree_mutator((Query *) node,
|
||||
flatten_group_exprs_mutator,
|
||||
(void *) context,
|
||||
context,
|
||||
QTW_IGNORE_GROUPEXPRS);
|
||||
newnode->hasSubLinks |= context->inserted_sublink;
|
||||
context->inserted_sublink = save_inserted_sublink;
|
||||
@ -1053,7 +1048,7 @@ flatten_group_exprs_mutator(Node *node,
|
||||
}
|
||||
|
||||
return expression_tree_mutator(node, flatten_group_exprs_mutator,
|
||||
(void *) context);
|
||||
context);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user