summaryrefslogtreecommitdiff
path: root/src/backend/nodes/copyfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-09-28 12:08:56 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2010-09-28 14:18:22 -0400
commit4ec15077b2eaa1f7713e4fff87e220a23c772688 (patch)
tree68a194b48c7cb17407f74350fd92073ededbb3ce /src/backend/nodes/copyfuncs.c
parentcd1454cdc357593f1d17fd33b9583511a9fe57b1 (diff)
Fix PlaceHolderVar mechanism's interaction with outer joins.
The point of a PlaceHolderVar is to allow a non-strict expression to be evaluated below an outer join, after which its value bubbles up like a Var and can be forced to NULL when the outer join's semantics require that. However, there was a serious design oversight in that, namely that we didn't ensure that there was actually a correct place in the plan tree to evaluate the placeholder :-(. It may be necessary to delay evaluation of an outer join to ensure that a placeholder that should be evaluated below the join can be evaluated there. Per recent bug report from Kirill Simonov. Back-patch to 8.4 where the PlaceHolderVar mechanism was introduced.
Diffstat (limited to 'src/backend/nodes/copyfuncs.c')
-rw-r--r--src/backend/nodes/copyfuncs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
index 3e237c11d9b..6e6844badea 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -1787,6 +1787,7 @@ _copyPlaceHolderInfo(PlaceHolderInfo *from)
COPY_NODE_FIELD(ph_var);
COPY_BITMAPSET_FIELD(ph_eval_at);
COPY_BITMAPSET_FIELD(ph_needed);
+ COPY_BITMAPSET_FIELD(ph_may_need);
COPY_SCALAR_FIELD(ph_width);
return newnode;