aboutsummaryrefslogtreecommitdiff
path: root/src/include/parser/parse_node.h
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2015-07-24 11:48:53 +0200
committerAndres Freund <andres@anarazel.de>2015-07-24 11:52:07 +0200
commitc1ca3a19df376bcbb6d651d15b9a4ffcaa377ff1 (patch)
tree2b4f9277d4cd45da95aa1b2eda87527bb0a06d83 /src/include/parser/parse_node.h
parent16c33c50e122e3e7d03fc7ddd5cbd105c0118234 (diff)
downloadpostgresql-c1ca3a19df376bcbb6d651d15b9a4ffcaa377ff1.tar.gz
postgresql-c1ca3a19df376bcbb6d651d15b9a4ffcaa377ff1.zip
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
Diffstat (limited to 'src/include/parser/parse_node.h')
-rw-r--r--src/include/parser/parse_node.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/include/parser/parse_node.h b/src/include/parser/parse_node.h
index 3103b715944..7ecaffc0dc3 100644
--- a/src/include/parser/parse_node.h
+++ b/src/include/parser/parse_node.h
@@ -152,7 +152,6 @@ struct ParseState
bool p_hasSubLinks;
bool p_hasModifyingCTE;
bool p_is_insert;
- bool p_is_update;
bool p_locked_from_parent;
Relation p_target_relation;
RangeTblEntry *p_target_rangetblentry;