From 6ef8c658af2127f4e62cb24feade8b465c9e2fea Mon Sep 17 00:00:00 2001 From: Stephen Frost Date: Mon, 22 Sep 2014 20:12:51 -0400 Subject: Process withCheckOption exprs in setrefs.c While withCheckOption exprs had been handled in many cases by happenstance, they need to be handled during set_plan_references and more specifically down in set_plan_refs for ModifyTable plan nodes. This is to ensure that the opfuncid's are set for operators referenced in the withCheckOption exprs. Identified as an issue by Thom Brown Patch by Dean Rasheed Back-patch to 9.4, where withCheckOption was introduced. --- src/backend/optimizer/plan/setrefs.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/backend/optimizer/plan/setrefs.c') diff --git a/src/backend/optimizer/plan/setrefs.c b/src/backend/optimizer/plan/setrefs.c index 5bf84c1a21..9ddc8adcf9 100644 --- a/src/backend/optimizer/plan/setrefs.c +++ b/src/backend/optimizer/plan/setrefs.c @@ -696,6 +696,9 @@ set_plan_refs(PlannerInfo *root, Plan *plan, int rtoffset) Assert(splan->plan.targetlist == NIL); Assert(splan->plan.qual == NIL); + splan->withCheckOptionLists = + fix_scan_list(root, splan->withCheckOptionLists, rtoffset); + if (splan->returningLists) { List *newRL = NIL; -- cgit v1.2.1