postgresql/src
Tom Lane 13192a324a Correctly update hasSubLinks while mutating a rule action.
rewriteRuleAction neglected to check for SubLink nodes in the
securityQuals of range table entries.  This could lead to failing
to convert such a SubLink to a SubPlan, resulting in assertion
crashes or weird errors later in planning.

In passing, fix some poor coding in rewriteTargetView:
we should not pass the source parsetree's hasSubLinks
field to ReplaceVarsFromTargetList's outer_hasSubLinks.
ReplaceVarsFromTargetList knows enough to ignore that
when a Query node is passed, but it's still confusing
and bad precedent: if we did try to update that flag
we'd be updating a stale copy of the parsetree.

Per bug #17972 from Alexander Lakhin.  This has been broken since
we added RangeTblEntry.securityQuals (although the presented test
case only fails back to 215b43cdc), so back-patch all the way.

Discussion: https://postgr.es/m/17972-f422c094237847d0@postgresql.org
2023-06-13 15:58:37 -04:00
..
backend Correctly update hasSubLinks while mutating a rule action. 2023-06-13 15:58:37 -04:00
bin Translation updates 2023-05-08 14:44:53 +02:00
common Inhibit mingw CRT's auto-globbing of command line arguments 2022-04-25 15:51:27 -04:00
fe_utils Clean up assorted failures under clang's -fsanitize=undefined checks. 2022-03-03 18:13:24 -05:00
include Fix handling of empty ranges and NULLs in BRIN 2023-05-19 00:21:05 +02:00
interfaces Stamp 11.20. 2023-05-08 17:21:16 -04:00
makefiles Select CFLAGS_SL at configure time, not in platform-specific Makefiles. 2019-10-21 12:32:36 -04:00
pl Translation updates 2023-05-08 14:44:53 +02:00
port Stamp 11.20. 2023-05-08 17:21:16 -04:00
template On NetBSD, force dynamic symbol resolution at postmaster start. 2022-08-30 17:29:17 -04:00
test Correctly update hasSubLinks while mutating a rule action. 2023-06-13 15:58:37 -04:00
timezone Update time zone data files to tzdata release 2023c. 2023-04-18 14:46:39 -04:00
tools Don't force SQL_ASCII/no-locale for installcheck in vcregress.pl 2023-02-26 06:55:59 -05:00
tutorial Doc: sync src/tutorial/basics.source with SGML documentation. 2022-11-19 13:09:14 -05:00
.gitignore
DEVELOPERS
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Fix prove_installcheck when used with PGXS 2023-05-05 07:12:26 +02:00
Makefile.shlib Ensure static libraries have correct mod time even if ranlib messes it up. 2018-11-29 15:53:44 -05:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00