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

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: bed5eac) | patch
Avoid trying to lock OLD/NEW in a rule with FOR UPDATE.
2021年8月19日 16:12:35 +0000 (12:12 -0400)
2021年8月19日 16:12:35 +0000 (12:12 -0400)
commit 8d2d6ec7708b475787fd92a9f828e554805e3df6
Avoid trying to lock OLD/NEW in a rule with FOR UPDATE.

transformLockingClause neglected to exclude the pseudo-RTEs for
OLD/NEW when processing a rule's query. This led to odd errors
or even crashes later on. This bug is very ancient, but it's
not terribly surprising that nobody noticed, since the use-case
for SELECT FOR UPDATE in a non-view rule is somewhere between
thin and non-existent. Still, crashing is not OK.

Per bug #17151 from Zhiyong Wu. Thanks to Masahiko Sawada
for analysis of the problem.

Discussion: https://postgr.es/m/17151-c03a3e6e4ec9aadb@postgresql.org
src/backend/parser/analyze.c diff | blob | blame | history
src/include/nodes/parsenodes.h diff | blob | blame | history
src/test/regress/expected/rules.out diff | blob | blame | history
src/test/regress/sql/rules.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

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