Skip to content

Commit cf33fb7

Browse files
committed
Remove bogus assertion in transformExpressionList().
I think when I added this assertion (in commit 8f889b1), 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
1 parent 687fe8a commit cf33fb7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/backend/parser/parse_target.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,9 @@ transformTargetList(ParseState *pstate, List *targetlist,
221221
* This is the identical transformation to transformTargetList, except that
222222
* the input list elements are bare expressions without ResTarget decoration,
223223
* and the output elements are likewise just expressions without TargetEntry
224-
* decoration. We use this for ROW() and VALUES() constructs.
224+
* decoration. Also, we don't expect any multiassign constructs within the
225+
* list, so there's nothing to do for that. We use this for ROW() and
226+
* VALUES() constructs.
225227
*
226228
* exprKind is not enough to tell us whether to allow SetToDefault, so
227229
* an additional flag is needed for that.
@@ -283,9 +285,6 @@ transformExpressionList(ParseState *pstate, List *exprlist,
283285
result = lappend(result, e);
284286
}
285287

286-
/* Shouldn't have any multiassign items here */
287-
Assert(pstate->p_multiassign_exprs == NIL);
288-
289288
return result;
290289
}
291290

0 commit comments

Comments
 (0)