diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2010-09-28 14:15:42 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2010-09-28 14:15:42 -0400 |
commit | dc9cc887b74bfa0d40829c4df66dead509fdd8f6 (patch) | |
tree | 90e39f8b5f06e7acfd07bd7b1ba525f1af41643b /src/backend/nodes/outfuncs.c | |
parent | 2dc2ea81f67b96473cefe8fc7d515bda37255660 (diff) | |
download | postgresql-dc9cc887b74bfa0d40829c4df66dead509fdd8f6.tar.gz postgresql-dc9cc887b74bfa0d40829c4df66dead509fdd8f6.zip |
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/outfuncs.c')
-rw-r--r-- | src/backend/nodes/outfuncs.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index 675db4dba97..443be9a739f 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -1689,6 +1689,7 @@ _outPlaceHolderInfo(StringInfo str, PlaceHolderInfo *node) WRITE_NODE_FIELD(ph_var); WRITE_BITMAPSET_FIELD(ph_eval_at); WRITE_BITMAPSET_FIELD(ph_needed); + WRITE_BITMAPSET_FIELD(ph_may_need); WRITE_INT_FIELD(ph_width); } |