Fix recursion into previously planned sub-query in examine_simple_variable.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 29 Sep 2011 22:12:34 +0000 (18:12 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 29 Sep 2011 22:13:16 +0000 (18:13 -0400)
commit79edb2b1dc33166b576f51a8255a7614f748d9c9
tree70892283cb8006ce6af93bf7eeb29de059020f19
parent054219c907a9fe668b2dac4134563b4f38e2b233
Fix recursion into previously planned sub-query in examine_simple_variable.

This code was looking at the sub-Query tree as seen in the parent query's
RangeTblEntry; but that's the pristine parser output, and what we need to
look at is the tree as it stands at the completion of planning.  Otherwise
we might pick up a Var that references a subquery that got flattened and
hence has no RelOptInfo in the subroot.  Per report from Peter Geoghegan.
src/backend/utils/adt/selfuncs.c