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

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 16c33c5) | patch
Fix bug around assignment expressions containing indirections.
2015年7月24日 09:48:53 +0000 (11:48 +0200)
2015年7月24日 09:52:07 +0000 (11:52 +0200)
commit c1ca3a19df376bcbb6d651d15b9a4ffcaa377ff1
Fix bug around assignment expressions containing indirections.

Handling of assigned-to expressions with indirection (e.g. set f1[1] =
3) was broken for ON CONFLICT DO UPDATE. The problem was that
ParseState was consulted to determine if an INSERT-appropriate or
UPDATE-appropriate behavior should be used when transforming expressions
with indirections. When the wrong path was taken the old row was
substituted with NULL, leading to wrong results..

To fix remove p_is_update and only use p_is_insert to decide how to
transform the assignment expression, and uset p_is_insert while parsing
the on conflict statement. This isn't particularly pretty, but it's not
any worse than before.

Author: Peter Geoghegan, slightly edited by me
Discussion: CAM3SWZS8RPvA=KFxADZWw3wAHnnbxMxDzkEC6fNaFc7zSm411w@mail.gmail.com
Backpatch: 9.5, where the feature was introduced
src/backend/parser/analyze.c diff | blob | blame | history
src/include/parser/parse_node.h diff | blob | blame | history
src/test/regress/expected/arrays.out diff | blob | blame | history
src/test/regress/sql/arrays.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

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