postgresql/src
Tom Lane 3af87736bf Fix another cause of "wrong varnullingrels" planner failures.
I removed the delay_upper_joins mechanism in commit b448f1c8d,
reasoning that it was only needed when we have a single-table
(SELECT ... WHERE) as the immediate RHS child of a left join,
and we could get rid of that by hoisting the WHERE condition into
the parent join's quals.  However that new code missed a case:
we could have "foo LEFT JOIN ((SELECT ... WHERE) LEFT JOIN bar)",
and if the two left joins can be commuted then we now have the
problematic query shape.  We can fix this too easily enough,
by allowing the syntactically-lower left join to pass through
its parent qual location pointer recursively.  That lets
prepjointree.c discard the SELECT by temporarily hoisting the
WHERE condition into the ancestor join's qual.

Per bug #17978 from Zuming Jiang.

Discussion: https://postgr.es/m/17978-12f3d93a55297266@postgresql.org
2023-06-20 11:09:56 -04:00
..
backend Fix another cause of "wrong varnullingrels" planner failures. 2023-06-20 11:09:56 -04:00
bin Pre-beta2 mechanical code beautification. 2023-06-20 09:50:43 -04:00
common meson: Add dependencies to perl modules to various script invocations 2023-06-09 20:12:16 -07:00
fe_utils Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
include Pre-beta2 mechanical code beautification. 2023-06-20 09:50:43 -04:00
interfaces libpq: Add missing gettext trigger 2023-06-16 10:53:22 +02:00
makefiles Use --strip-unneeded when stripping static libraries with GNU strip. 2023-04-20 18:12:32 -04:00
pl meson: Add dependencies to perl modules to various script invocations 2023-06-09 20:12:16 -07:00
port Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
template Use unnamed POSIX semaphores on Cygwin. 2023-01-06 10:33:28 +13:00
test Fix another cause of "wrong varnullingrels" planner failures. 2023-06-20 11:09:56 -04:00
timezone Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
tools Fix make_etags breakage on certain platforms. 2023-06-14 11:02:50 +09:00
tutorial Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
.gitignore
DEVELOPERS
Makefile Integrate pg_bsd_indent into our build/test infrastructure. 2023-02-12 12:22:21 -05:00
Makefile.global.in Fix prove_installcheck when used with PGXS 2023-05-05 07:09:52 +02:00
Makefile.shlib autoconf: Rely on ar supporting index creation 2022-10-07 11:53:39 -07:00
meson.build Integrate pg_bsd_indent into our build/test infrastructure. 2023-02-12 12:22:21 -05:00
nls-global.mk Fix for make unportability 2022-07-13 09:15:01 +02:00