git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: d5e6891) | patch
Avoid unhelpful internal error for incorrect recursive-WITH queries.
2024年7月14日 17:49:46 +0000 (13:49 -0400)
2024年7月14日 17:49:46 +0000 (13:49 -0400)
commit f96c2c72788cab3005c8bc6b4934b4928b34a529
Avoid unhelpful internal error for incorrect recursive-WITH queries.

checkWellFormedRecursion would issue "missing recursive reference"
if a WITH RECURSIVE query contained a single self-reference but
that self-reference was inside a top-level WITH, ORDER BY, LIMIT,
etc, rather than inside the second arm of the UNION as expected.
We already intended to throw more-on-point errors for such cases,
but those error checks must be done before examining the UNION arm
in order to have the desired results. So this patch need only
move some code (and improve the comments).

Per bug #18536 from Alexander Lakhin. Back-patch to all supported
branches.

Discussion: https://postgr.es/m/18536-0a342ec07901203e@postgresql.org
src/backend/parser/parse_cte.c diff | blob | blame | history
src/test/regress/expected/with.out diff | blob | blame | history
src/test/regress/sql/with.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /