]> granicus.if.org Git - postgresql/commit
Ignore extra subquery outputs in set_subquery_size_estimates().
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 31 Mar 2013 22:33:01 +0000 (18:33 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 31 Mar 2013 22:34:31 +0000 (18:34 -0400)
commit0044f456d909b12f6bea2fff4d48fc0848b1b54b
tree3c6f6300ee7d58f46ad576ce2f37502c2466746e
parent4d001c3540f8dfe45f294d7990f167e8038d0cd0
Ignore extra subquery outputs in set_subquery_size_estimates().

In commit 0f61d4dd1b4f95832dcd81c9688dac56fd6b5687, I added code to copy up
column width estimates for each column of a subquery.  That code supposed
that the subquery couldn't have any output columns that didn't correspond
to known columns of the current query level --- which is true when a query
is parsed from scratch, but the assumption fails when planning a view that
depends on another view that's been redefined (adding output columns) since
the upper view was made.  This results in an assertion failure or even a
crash, as per bug #8025 from lindebg.  Remove the Assert and instead skip
the column if its resno is out of the expected range.
src/backend/optimizer/path/costsize.c