postgresql/src
Tom Lane 29f114b6ff Allow subquery pullup to wrap a PlaceHolderVar in another one.
The code for wrapping subquery output expressions in PlaceHolderVars
believed that if the expression already was a PlaceHolderVar, it was
never necessary to wrap that in another one.  That's wrong if the
expression is underneath an outer join and involves a lateral
reference to outside that scope: failing to add an additional PHV
risks evaluating the expression at the wrong place and hence not
forcing it to null when the outer join should do so.  This is an
oversight in commit 9e7e29c75, which added logic to forcibly wrap
lateral-reference Vars in PlaceHolderVars, but didn't see that the
adjacent case for PlaceHolderVars needed the same treatment.

The test case we have for this doesn't fail before 4be058fe9, but now
that I see the problem I wonder if it is possible to demonstrate
related errors before that.  That's moot though, since all such
branches are out of support.

Per bug #18284 from Holger Reise.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/18284-47505a20c23647f8@postgresql.org
2024-01-11 15:28:22 -05:00
..
backend Allow subquery pullup to wrap a PlaceHolderVar in another one. 2024-01-11 15:28:22 -05:00
bin Try to fix pg_walsummary buildfarm failures. 2024-01-11 15:01:51 -05:00
common Repair various defects in dc21234005. 2024-01-11 13:06:10 -05:00
fe_utils Update copyright for 2024 2024-01-03 20:49:05 -05:00
include Add new function pg_get_wal_summarizer_state(). 2024-01-11 12:41:18 -05:00
interfaces Add new function, PQchangePassword(), to libpq 2024-01-09 09:16:48 -05:00
makefiles Update copyright for 2024 2024-01-03 20:49:05 -05:00
pl Clean up some edge cases in plpgsql's %TYPE parsing. 2024-01-05 14:32:34 -05:00
port Update copyright for 2024 2024-01-03 20:49:05 -05:00
template Use unnamed POSIX semaphores on Cygwin. 2023-01-06 10:33:28 +13:00
test Allow subquery pullup to wrap a PlaceHolderVar in another one. 2024-01-11 15:28:22 -05:00
timezone Update copyright for 2024 2024-01-03 20:49:05 -05:00
tools Add new pg_walsummary tool. 2024-01-11 12:48:27 -05:00
tutorial Update copyright for 2024 2024-01-03 20:49:05 -05:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in Initialize data directories with --lc-messages=C for tests. 2023-12-21 15:10:13 -08:00
Makefile.shlib Stop using "-multiply_defined suppress" on macOS. 2023-09-26 21:06:21 -04:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
nls-global.mk Remove distprep 2023-11-06 15:18:04 +01:00