postgresql/src
Dean Rasheed 33e729c514 Fix EXPLAIN output for subplans in MERGE.
Given a subplan in a MERGE query, EXPLAIN would sometimes fail to
properly display expressions involving Params referencing variables in
other parts of the plan tree.

This would affect subplans outside the topmost join plan node, for
which expansion of Params would go via the top-level ModifyTable plan
node.  The problem was that "inner_tlist" for the ModifyTable node's
deparse_namespace was set to the join node's targetlist, but
"inner_plan" was set to the ModifyTable node itself, rather than the
join node, leading to incorrect results when descending to the
referenced variable.

Fix and backpatch to v15, where MERGE was introduced.

Discussion: https://postgr.es/m/CAEZATCWAv-sZuH%2BwG5xJ-%2BGt7qGNGX8wUQd3XYydMFDKgRB9nw%40mail.gmail.com
2024-03-17 10:17:11 +00:00
..
backend Fix EXPLAIN output for subplans in MERGE. 2024-03-17 10:17:11 +00:00
bin Add destroyStringInfo function for cleaning up StringInfos 2024-03-16 23:18:28 +01:00
common Add destroyStringInfo function for cleaning up StringInfos 2024-03-16 23:18:28 +01:00
fe_utils Centralize logic for restoring errno in signal handlers. 2024-02-14 16:34:18 -06:00
include Separate equalRowTypes() from equalTupleDescs() 2024-03-17 05:58:04 +01:00
interfaces Make the order of the header file includes consistent 2024-03-13 15:07:00 +01:00
makefiles Remove AIX support 2024-02-28 15:17:23 +04:00
pl Make the order of the header file includes consistent 2024-03-13 15:07:00 +01:00
port Use printf's %m format instead of strerror(errno) in more places 2024-03-12 10:02:54 +09:00
template Remove AIX support 2024-02-28 15:17:23 +04:00
test Fix EXPLAIN output for subplans in MERGE. 2024-03-17 10:17:11 +00:00
timezone Update time zone data files to tzdata release 2024a. 2024-02-01 15:57:53 -05:00
tools Put genbki.pl output into src/include/catalog/ directly 2024-03-14 07:11:21 +01: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 Remove make function vpathsearch 2024-01-29 07:24:59 +01:00
Makefile.shlib Remove AIX support 2024-02-28 15:17:23 +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