postgresql/src/backend/optimizer/path
Tom Lane 77ba232564 Fix nested PlaceHolderVar expressions that appear only in targetlists.
A PlaceHolderVar's expression might contain another, lower-level
PlaceHolderVar.  If the outer PlaceHolderVar is used, the inner one
certainly will be also, and so we have to make sure that both of them get
into the placeholder_list with correct ph_may_need values during the
initial pre-scan of the query (before deconstruct_jointree starts).
We did this correctly for PlaceHolderVars appearing in the query quals,
but overlooked the issue for those appearing in the top-level targetlist;
with the result that nested placeholders referenced only in the targetlist
did not work correctly, as illustrated in bug #6154.

While at it, add some error checking to find_placeholder_info to ensure
that we don't try to create new placeholders after it's too late to do so;
they have to all be created before deconstruct_jointree starts.

Back-patch to 8.4 where the PlaceHolderVar mechanism was introduced.
2011-08-09 00:50:07 -04:00
..
Makefile Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
allpaths.c Avoid listing ungrouped Vars in the targetlist of Agg-underneath-Window. 2011-07-12 18:24:39 -04:00
clausesel.c Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
costsize.c Fix nested PlaceHolderVar expressions that appear only in targetlists. 2011-08-09 00:50:07 -04:00
equivclass.c Fix nested PlaceHolderVar expressions that appear only in targetlists. 2011-08-09 00:50:07 -04:00
indxpath.c Pass collations to functions in FunctionCallInfoData, not FmgrInfo. 2011-04-12 19:19:24 -04:00
joinpath.c pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
joinrels.c Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
orindxpath.c Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
pathkeys.c pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
tidpath.c Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00