pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dmitry Dolgov <9erthalion6@gmail.com>
To: exclusion@gmail.com
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17897: Crash on assignment to array of constraint-less domain over composite type
Date: Sat, 15 Apr 2023 17:17:09 +0200
Message-ID: <20230415151709.jh7ygoak2fc2msdb@erthalion.local> (raw)
In-Reply-To: <17897-4216c546c3874044@postgresql.org>
References: <17897-4216c546c3874044@postgresql.org>

> 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 ?

inline patch 1: src/backend/executor/execExpr.c (+0/-0 lines) download inline-1.patchdiff --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; }

view thread (3+ messages)  latest in thread

Message-ID: <20230415151709.jh7ygoak2fc2msdb@erthalion.local>
Permalink:  ../20230415151709.jh7ygoak2fc2msdb@erthalion.local/
Also on:    postgresql.org/message-id/20230415151709.jh7ygoak2fc2msdb@erthalion.local

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: 9erthalion6@gmail.com, exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17897: Crash on assignment to array of constraint-less domain over composite type
  In-Reply-To: <20230415151709.jh7ygoak2fc2msdb@erthalion.local>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox