summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2021-10-19 11:35:15 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2021-10-19 11:35:15 -0400
commit9681c8fd5fd03f9abe830049575c156534f4f587 (patch)
tree3a540377a562ffa4eadcc687ea7720eca2e2536b
parent4fda03b671a6849972d0a66b4af5518cd2a97a70 (diff)
Remove bogus assertion in transformExpressionList().
I think when I added this assertion (in commit 8f889b108), I was only thinking of the use of transformExpressionList at top level of INSERT and VALUES. But it's also called by transformRowExpr(), which can certainly occur in an UPDATE targetlist, so it's inappropriate to suppose that p_multiassign_exprs must be empty. Besides, since the input is not expected to contain ResTargets, there's no reason it should contain MultiAssignRefs either. Hence this code need not be concerned about the state of p_multiassign_exprs, and we should just drop the assertion. Per bug #17236 from ocean_li_996. It's been wrong for years, so back-patch to all supported branches. Discussion: https://postgr.es/m/17236-3210de9bcba1d7ca@postgresql.org
-rw-r--r--src/backend/parser/parse_target.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/backend/parser/parse_target.c b/src/backend/parser/parse_target.c
index 64a1b75ccc4..95a74776cb1 100644
--- a/src/backend/parser/parse_target.c
+++ b/src/backend/parser/parse_target.c
@@ -219,7 +219,9 @@ transformTargetList(ParseState *pstate, List *targetlist,
* This is the identical transformation to transformTargetList, except that
* the input list elements are bare expressions without ResTarget decoration,
* and the output elements are likewise just expressions without TargetEntry
- * decoration. We use this for ROW() and VALUES() constructs.
+ * decoration. Also, we don't expect any multiassign constructs within the
+ * list, so there's nothing to do for that. We use this for ROW() and
+ * VALUES() constructs.
*
* exprKind is not enough to tell us whether to allow SetToDefault, so
* an additional flag is needed for that.
@@ -281,9 +283,6 @@ transformExpressionList(ParseState *pstate, List *exprlist,
result = lappend(result, e);
}
- /* Shouldn't have any multiassign items here */
- Assert(pstate->p_multiassign_exprs == NIL);
-
return result;
}