postgresql/src/test/regress
Tom Lane e8638d78a2 Fix planner error with multiple copies of an AlternativeSubPlan.
It's possible for us to copy an AlternativeSubPlan expression node
into multiple places, for example the scan quals of several
partition children.  Then it's possible that we choose a different
one of the alternatives as optimal in each place.  Commit 41efb8340
failed to consider this scenario, so its attempt to remove "unused"
subplans could remove subplans that were still used elsewhere.

Fix by delaying the removal logic until we've examined all the
AlternativeSubPlans in a given query level.  (This does assume that
AlternativeSubPlans couldn't get copied to other query levels, but
for the foreseeable future that's fine; cf qual_is_pushdown_safe.)

Per report from Rajkumar Raghuwanshi.  Back-patch to v14
where the faulty logic came in.

Discussion: https://postgr.es/m/CAKcux6==O3NNZC3bZ2prRYv3cjm3_Zw1GfzmOjEVqYN4jub2+Q@mail.gmail.com
2021-09-14 15:11:21 -04:00
..
data Fix full text search to handle NOT above a phrase search correctly. 2020-04-27 12:21:04 -04:00
expected Fix planner error with multiple copies of an AlternativeSubPlan. 2021-09-14 15:11:21 -04:00
input Revoke PUBLIC CREATE from public schema, now owned by pg_database_owner. 2021-09-09 23:38:09 -07:00
output Revoke PUBLIC CREATE from public schema, now owned by pg_database_owner. 2021-09-09 23:38:09 -07:00
sql Fix planner error with multiple copies of an AlternativeSubPlan. 2021-09-14 15:11:21 -04:00
.gitignore Fix inconsistencies and typos in the tree, take 10 2019-08-13 13:53:41 +09:00
GNUmakefile Avoid creating testtablespace directories where not wanted. 2021-05-19 14:04:01 -04:00
Makefile Fix non-GNU makefiles for AIX make. 2017-11-30 00:57:22 -08:00
parallel_schedule Change the name of the Result Cache node to Memoize 2021-07-14 12:43:58 +12:00
pg_regress_main.c Allow configurable LZ4 TOAST compression. 2021-03-19 15:10:38 -04:00
pg_regress.c Ignore more environment variables in pg_regress.c 2021-06-13 20:07:39 +09:00
pg_regress.h Allow pg_regress.c wrappers to postprocess test result files. 2021-01-11 13:43:19 -05:00
README Don't generate plain-text HISTORY and src/test/regress/README anymore. 2014-02-10 20:48:04 -05:00
regress.c Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
regressplans.sh Fix inconsistencies in the code 2019-07-08 13:15:09 +09:00
resultmap Cygwin and Mingw floating-point fixes. 2019-02-16 01:50:16 +00:00
standby_schedule Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00

Documentation concerning how to run these regression tests and interpret
the results can be found in the PostgreSQL manual, in the chapter
"Regression Tests".