postgresql/src
Tom Lane 5b948b5c13 Fix handling of R/W expanded datums that are passed to SQL functions.
fmgr_sql must make expanded-datum arguments read-only, because
it's possible that the function body will pass the argument to
more than one callee function.  If one of those functions takes
the datum's R/W property as license to scribble on it, then later
callees will see an unexpected value, leading to wrong answers.

From a performance standpoint, it'd be nice to skip this in the
common case that the argument value is passed to only one callee.
However, detecting that seems fairly hard, and certainly not
something that I care to attempt in a back-patched bug fix.

Per report from Adam Mackler.  This has been broken since we
invented expanded datums, so back-patch to all supported branches.

Discussion: https://postgr.es/m/WScDU5qfoZ7PB2gXwNqwGGgDPmWzz08VdydcPFLhOwUKZcdWbblbo-0Lku-qhuEiZoXJ82jpiQU4hOjOcrevYEDeoAvz6nR0IU4IHhXnaCA=@mackler.email
Discussion: https://postgr.es/m/187436.1660143060@sss.pgh.pa.us
2022-08-10 13:37:25 -04:00
..
backend Fix handling of R/W expanded datums that are passed to SQL functions. 2022-08-10 13:37:25 -04:00
bin Translation updates 2022-08-08 12:39:52 +02:00
common Inhibit mingw CRT's auto-globbing of command line arguments 2022-04-25 15:50:07 -04:00
fe_utils Clean up assorted failures under clang's -fsanitize=undefined checks. 2022-03-03 18:13:24 -05:00
include Stamp 12.12. 2022-08-08 16:47:33 -04:00
interfaces Stamp 12.12. 2022-08-08 16:47:33 -04:00
makefiles
pl Translation updates 2022-08-08 12:39:52 +02:00
port Stamp 12.12. 2022-08-08 16:47:33 -04:00
template Further tweaking of PG_SYSROOT heuristics for macOS. 2021-01-20 12:07:35 -05:00
test Fix handling of R/W expanded datums that are passed to SQL functions. 2022-08-10 13:37:25 -04:00
timezone Update time zone data files to tzdata release 2022a. 2022-05-05 14:55:17 -04:00
tools Improve setup of environment values for commands in MSVC's vcregress.pl 2022-05-11 10:22:37 +09:00
tutorial tutorial: land height is "elevation", not "altitude" 2021-03-10 20:25:18 -05:00
.gitignore
DEVELOPERS
Makefile
Makefile.global.in Fix prove_installcheck to use correct paths when used with PGXS 2021-07-01 08:47:04 -04:00
Makefile.shlib Fix pkg-config files for static linking 2021-09-06 09:43:18 +02:00
nls-global.mk