Fix subselect.c to avoid assuming that a SubLink's testexpr references each
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 17 Jan 2008 20:35:34 +0000 (20:35 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 17 Jan 2008 20:35:34 +0000 (20:35 +0000)
commite1325350617bda70f81fb75e899ea92bee19b8db
treebdc4b88cede9060c97f7fd6f14105e3b8244b62f
parent7ff56058b686d18d86dc479132fa818d50c015f5
Fix subselect.c to avoid assuming that a SubLink's testexpr references each
subquery output column exactly once left-to-right.  Although this is the case
in the original parser output, it might not be so after rewriting and
constant-folding, as illustrated by bug #3882 from Jan Mate.  Instead
scan the subquery's target list to obtain needed per-column information;
this is duplicative of what the parser did, but only a couple dozen lines
need be copied, and we can clean up a couple of notational uglinesses.
Bug was introduced in 8.2 as part of revision of SubLink representation.
src/backend/optimizer/plan/subselect.c