diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2022-04-23 12:16:12 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2022-04-23 12:16:12 -0400 |
commit | dff6c77faf0c6bcf1d407dc3ffef9e169166c714 (patch) | |
tree | 12021888786a85aea9d0ae1522f5f64f6fa0920d /src/backend/utils/adt/regexp.c | |
parent | da22ef388a2469c3d7d11a8c97a3c41cc0016f4a (diff) | |
download | postgresql-dff6c77faf0c6bcf1d407dc3ffef9e169166c714.tar.gz postgresql-dff6c77faf0c6bcf1d407dc3ffef9e169166c714.zip |
Fix incautious CTE matching in rewriteSearchAndCycle().
This function looks for a reference to the recursive WITH CTE,
but it checked only the CTE name not ctelevelsup, so that it could
seize on a lower CTE that happened to have the same name. This
would result in planner failures later, either weird errors such as
"could not find attribute 2 in subquery targetlist", or crashes
or assertion failures. The code also merely Assert'ed that it found
a matching entry, which is not guaranteed at all by the parser.
Per bugs #17320 and #17318 from Zhiyong Wu.
Thanks to Kyotaro Horiguchi for investigation.
Discussion: https://postgr.es/m/17320-70e37868182512ab@postgresql.org
Discussion: https://postgr.es/m/17318-2eb65a3a611d2368@postgresql.org
Diffstat (limited to 'src/backend/utils/adt/regexp.c')
0 files changed, 0 insertions, 0 deletions