MCPcopy Create free account
hub / github.com/apache/cloudberry / fix_upper_expr

Function fix_upper_expr

src/backend/optimizer/plan/setrefs.c:3533–3549  ·  view source on GitHub ↗

* fix_upper_expr * Modifies an expression tree so that all Var nodes reference outputs * of a subplan. Also looks for Aggref nodes that should be replaced * by initplan output Params. Also performs opcode lookup, and adds * regclass OIDs to root->glob->relationOids. * * This is used to fix up target and qual expressions of non-join upper-level * plan nodes, as well as index-only scan

Source from the content-addressed store, hash-verified

3531 * The original tree is not modified.
3532 */
3533static Node *
3534fix_upper_expr(PlannerInfo *root,
3535 Node *node,
3536 indexed_tlist *subplan_itlist,
3537 Index newvarno,
3538 int rtoffset,
3539 double num_exec)
3540{
3541 fix_upper_expr_context context;
3542
3543 context.root = root;
3544 context.subplan_itlist = subplan_itlist;
3545 context.newvarno = newvarno;
3546 context.rtoffset = rtoffset;
3547 context.num_exec = num_exec;
3548 return fix_upper_expr_mutator(node, &context);
3549}
3550
3551static Node *
3552fix_upper_expr_mutator(Node *node, fix_upper_expr_context *context)

Callers 7

set_plan_refsFunction · 0.85
set_hash_referencesFunction · 0.85
set_join_referencesFunction · 0.85
set_upper_referencesFunction · 0.85

Calls 1

fix_upper_expr_mutatorFunction · 0.85

Tested by

no test coverage detected