Skip to content

Commit

Permalink
Handle reset of the context correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Dipesh Dhameliya committed Nov 11, 2024
1 parent 6237170 commit d861957
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/backend/optimizer/plan/planner.c
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,10 @@ preprocess_expression(PlannerInfo *root, Node *expr, int kind)
if (kind != EXPRKIND_RTFUNC)
expr = eval_const_expressions(root, expr);

/* Reset context of expression */
if(EXPRKIND_TARGET == kind && planner_node_transformer_hook)
(void) planner_node_transformer_hook(root, NULL, -1);

/*
* If it's a qual or havingQual, canonicalize it.
*/
Expand All @@ -1169,10 +1173,6 @@ preprocess_expression(PlannerInfo *root, Node *expr, int kind)
pprint(expr);
#endif

/* Reset context of expression */
if(EXPRKIND_TARGET == kind && planner_node_transformer_hook)
expr = planner_node_transformer_hook(root, NULL, -1);

}

/*
Expand Down

0 comments on commit d861957

Please sign in to comment.