diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-14 19:16:24 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-14 19:16:24 +0000 |
commit | 2a0f262beff32ba86bcb58f3273214e5d0517c09 (patch) | |
tree | 24c0ad10dab36bbd5c22743d3c88c4e0ccd5bc65 /src/backend/parser/analyze.c | |
parent | Releasing progress-linux version 16.2-2~progress7.99u1. (diff) | |
download | postgresql-16-2a0f262beff32ba86bcb58f3273214e5d0517c09.tar.xz postgresql-16-2a0f262beff32ba86bcb58f3273214e5d0517c09.zip |
Merging upstream version 16.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/backend/parser/analyze.c')
-rw-r--r-- | src/backend/parser/analyze.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index 7a1dfb6..aad46fe 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -1072,17 +1072,28 @@ transformInsertRow(ParseState *pstate, List *exprlist, if (strip_indirection) { + /* + * We need to remove top-level FieldStores and SubscriptingRefs, + * as well as any CoerceToDomain appearing above one of those --- + * but not a CoerceToDomain that isn't above one of those. + */ while (expr) { - if (IsA(expr, FieldStore)) + Expr *subexpr = expr; + + while (IsA(subexpr, CoerceToDomain)) + { + subexpr = ((CoerceToDomain *) subexpr)->arg; + } + if (IsA(subexpr, FieldStore)) { - FieldStore *fstore = (FieldStore *) expr; + FieldStore *fstore = (FieldStore *) subexpr; expr = (Expr *) linitial(fstore->newvals); } - else if (IsA(expr, SubscriptingRef)) + else if (IsA(subexpr, SubscriptingRef)) { - SubscriptingRef *sbsref = (SubscriptingRef *) expr; + SubscriptingRef *sbsref = (SubscriptingRef *) subexpr; if (sbsref->refassgnexpr == NULL) break; |