> On Fri, Apr 14, 2023 at 07:00:01PM +0000, PG Bug reporting form wrote:
>
> The following modified excerpt from regress/sql/domain.sql:
> create type comptype as (cf1 int, cf2 int);
> create domain dcomptype as comptype;
>
> create table dcomptable (f1 dcomptype[]);
> insert into dcomptable values (null);
> update dcomptable set f1[1].cf2 = 5;
>
> causes a server crash with the following stack trace:
> [...]
> Not reproduced on REL_11_STABLE, but reproduced on REL_12_STABLE .. master
> since 04fe805a1 made a constraint-less domain represented as a RelabelType
> (not CoerceToDomain) and thus the fix for [1] (ae7b1dd59) doesn't cover
> this
> case.
Looks like it could be fixed in the same way as in ae7b1dd59 ?
diff --git a/src/backend/executor/execExpr.c b/src/backend/executor/execExpr.c
index 4c6700de04..06fbf19423 100644
--- a/src/backend/executor/execExpr.c
+++ b/src/backend/executor/execExpr.c
@@ -3253,6 +3253,12 @@ isAssignmentIndirectionExpr(Expr *expr)
return isAssignmentIndirectionExpr(cd->arg);
}
+ else if (IsA(expr, RelabelType))
+ {
+ RelabelType *rt = (RelabelType *) expr;
+
+ return isAssignmentIndirectionExpr(rt->arg);
+ }
return false;
}