1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

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.
This commit is contained in:
Stephen Frost
2014-09-22 20:12:51 -04:00
parent 6ba4ecbf47
commit 6ef8c658af
3 changed files with 42 additions and 0 deletions

View File

@ -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;