postgresql/src/backend
Tom Lane 80ca8464fe Fix list-manipulation bug in WITH RECURSIVE processing.
makeDependencyGraphWalker and checkWellFormedRecursionWalker
thought they could hold onto a pointer to a list's first
cons cell while the list was modified by recursive calls.
That was okay when the cons cell was actually separately
palloc'd ... but since commit 1cff1b95a, it's quite unsafe,
leading to core dumps or incorrect complaints of faulty
WITH nesting.

In the field this'd require at least a seven-deep WITH nest
to cause an issue, but enabling DEBUG_LIST_MEMORY_USAGE
allows the bug to be seen with lesser nesting depths.

Per bug #16801 from Alexander Lakhin.  Back-patch to v13.

Michael Paquier and Tom Lane

Discussion: https://postgr.es/m/16801-393c7922143eaa4d@postgresql.org
2021-02-25 20:47:32 -05:00
..
access VACUUM VERBOSE: Count "newly deleted" index pages. 2021-02-25 14:32:18 -08:00
bootstrap Update copyright for 2021 2021-01-02 13:06:25 -05:00
catalog Fix relcache reference leak introduced by ce0fdbfe97. 2021-02-25 07:48:24 +05:30
commands Fix some typos, grammar and style in docs and comments 2021-02-24 16:13:17 +09:00
executor Fix some typos, grammar and style in docs and comments 2021-02-24 16:13:17 +09:00
foreign Update copyright for 2021 2021-01-02 13:06:25 -05:00
jit Use errmsg_internal for debug messages 2021-02-17 11:33:25 +01:00
lib Update copyright for 2021 2021-01-02 13:06:25 -05:00
libpq Change the error message for logical replication authentication failure. 2021-02-23 09:11:22 +05:30
main Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodes Remove [Merge]AppendPath.partitioned_rels. 2021-02-01 14:43:54 -05:00
optimizer Fix some typos, grammar and style in docs and comments 2021-02-24 16:13:17 +09:00
parser Fix list-manipulation bug in WITH RECURSIVE processing. 2021-02-25 20:47:32 -05:00
partitioning Message style fix 2021-02-24 07:00:49 +01:00
po Translation updates 2020-05-18 12:49:30 +02:00
port Use errmsg_internal for debug messages 2021-02-17 11:33:25 +01:00
postmaster Use errmsg_internal for debug messages 2021-02-17 11:33:25 +01:00
regex Doc: remove src/backend/regex/re_syntax.n. 2021-02-25 13:33:27 -05:00
replication Simplify printing of LSNs 2021-02-23 10:27:02 +01:00
rewrite Revert "Propagate CTE property flags when copying a CTE list into a rule." 2021-02-07 12:54:08 -05:00
snowball Update snowball 2021-02-19 08:10:15 +01:00
statistics Update copyright for 2021 2021-01-02 13:06:25 -05:00
storage Use full 64-bit XIDs in deleted nbtree pages. 2021-02-24 18:41:34 -08:00
tcop Use errmsg_internal for debug messages 2021-02-17 11:33:25 +01:00
tsearch Fix parsing of complex morphs to tsquery 2021-01-31 20:14:29 +03:00
utils Fix some typos, grammar and style in docs and comments 2021-02-24 16:13:17 +09:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Update copyright for 2021 2021-01-02 13:06:25 -05:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
nls.mk Add missing gettext triggers 2020-04-28 13:35:40 +02:00