postgresql/src
Tom Lane f535f350c1 Fix handling of polymorphic output arguments for procedures.
Most of the infrastructure for procedure arguments was already
okay with polymorphic output arguments, but it turns out that
CallStmtResultDesc() was a few bricks shy of a load here.  It thought
all it needed to do was call build_function_result_tupdesc_t, but
that function specifically disclaims responsibility for resolving
polymorphic arguments.  Failing to handle that doesn't seem to be
a problem for CALL in plpgsql, but CALL from plain SQL would get
errors like "cannot display a value of type anyelement", or even
crash outright.

In v14 and later we can simply examine the exposed types of the
CallStmt.outargs nodes to get the right type OIDs.  But it's a lot
more complicated to fix in v12/v13, because those versions don't
have CallStmt.outargs, nor do they do expand_function_arguments
until ExecuteCallStmt runs.  We have to duplicatively run
expand_function_arguments, and then re-determine which elements
of the args list are output arguments.

Per bug #18463 from Drew Kimball.  Back-patch to all supported
versions, since it's busted in all of them.

Discussion: https://postgr.es/m/18463-f8cd77e12564d8a2@postgresql.org
2024-05-14 20:19:20 -04:00
..
backend Fix handling of polymorphic output arguments for procedures. 2024-05-14 20:19:20 -04:00
bin Pre-beta mechanical code beautification. 2024-05-14 16:34:50 -04:00
common Pre-beta mechanical code beautification. 2024-05-14 16:34:50 -04:00
fe_utils Fix an assortment of typos 2024-05-04 02:33:25 +12:00
include Do pre-release housekeeping on catalog data. 2024-05-14 16:46:38 -04:00
interfaces Pre-beta mechanical code beautification. 2024-05-14 16:34:50 -04:00
makefiles Optimize pg_popcount() with AVX-512 instructions. 2024-04-06 21:56:23 -05:00
pl Fix handling of polymorphic output arguments for procedures. 2024-05-14 20:19:20 -04:00
port Pre-beta mechanical code beautification. 2024-05-14 16:34:50 -04:00
template Remove AIX support 2024-02-28 15:17:23 +04:00
test Fix handling of polymorphic output arguments for procedures. 2024-05-14 20:19:20 -04:00
timezone Update time zone data files to tzdata release 2024a. 2024-02-01 15:57:53 -05:00
tools Pre-beta mechanical code beautification. 2024-05-14 16:34:50 -04: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 Update Unicode data to CLDR 45 2024-04-22 09:16:33 +02: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