postgresql/src/backend
Tom Lane 555494d1bc Fix placement of initPlans when forcibly materializing a subplan.
If we forcibly place a Material node atop a finished subplan, we need
to move any initPlans attached to the subplan up to the Material node,
in order to keep SS_finalize_plan() happy.  I'd figured this out in
commit 7b67a0a49 for the case of materializing a cursor plan, but out of
an abundance of caution, I put the initPlan movement hack at the call
site for that case, rather than inside materialize_finished_plan().
That was the wrong thing, because it turns out to also be necessary for
the only other caller of materialize_finished_plan(), ie subselect.c.
We lacked any test cases that exposed the mistake, but bug#14524 from
Wei Congrui shows that it's possible to get an initPlan reference into
the top tlist in that case too, and then SS_finalize_plan() complains.
Hence, move the hack into materialize_finished_plan().

In HEAD, also relocate some recently-added tests in subselect.sql, which
I'd unthinkingly dropped into the middle of a sequence of related tests.

Report: https://postgr.es/m/20170202060020.1400.89021@wrigleys.postgresql.org
2017-02-02 19:11:32 -05:00
..
access pageinspect: Support hash indexes. 2017-02-02 14:19:32 -05:00
bootstrap Remove dead code in bootstrap 2017-01-17 16:54:40 -03:00
catalog Fix CatalogTupleInsert/Update abstraction for case of shared indstate. 2017-02-01 17:18:36 -05:00
commands Fix CatalogTupleInsert/Update abstraction for case of shared indstate. 2017-02-01 17:18:36 -05:00
executor Use castNode() in a bunch of statement-list-related code. 2017-01-26 22:09:34 -05:00
foreign Generate fmgr prototypes automatically 2017-01-17 14:06:07 -05:00
lib Fix overflow check in StringInfo; add missing casts 2017-01-10 11:41:13 -03:00
libpq Silence compiler warning. 2017-02-02 10:42:37 +02:00
main Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
nodes Logical replication 2017-01-20 09:04:49 -05:00
optimizer Fix placement of initPlans when forcibly materializing a subplan. 2017-02-02 19:11:32 -05:00
parser Use castNode() in a bunch of statement-list-related code. 2017-01-26 22:09:34 -05:00
po Translation updates 2016-08-08 11:08:00 -04:00
port Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
postmaster Fix typo: pg_statistics -> pg_statistic 2017-01-25 14:38:33 -05:00
regex Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
replication Provide CatalogTupleDelete() as a wrapper around simple_heap_delete(). 2017-02-01 16:13:30 -05:00
rewrite Provide CatalogTupleDelete() as a wrapper around simple_heap_delete(). 2017-02-01 16:13:30 -05:00
snowball Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
storage Don't count background workers against a user's connection limit. 2017-02-01 18:02:43 -05:00
tcop Improve comments about ProcessUtility's queryString parameter. 2017-01-27 10:02:04 -05:00
tsearch Move some things from builtins.h to new header files 2017-01-20 20:29:53 -05:00
utils Increase upper bound for bgwriter_lru_maxpages. 2017-02-02 14:43:38 -05:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
Makefile Fix parallel make issue with new fmgrprotos.h 2017-01-23 15:36:27 -05:00
nls.mk Remove trailing slashes from directories in find command 2015-09-18 22:06:54 -04:00