pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix assignment to array of domain over composite.
Date: Tue, 19 Oct 2021 17:55:02 +0000
Message-ID: <E1mctKI-0002c5-KB@gemulon.postgresql.org> (raw)

Fix assignment to array of domain over composite.

An update such as "UPDATE ... SET fld[n].subfld = whatever"
failed if the array elements were domains rather than plain
composites.  That's because isAssignmentIndirectionExpr()
failed to cope with the CoerceToDomain node that would appear
in the expression tree in this case.  The result would typically
be a crash, and even if we accidentally didn't crash, we'd not
correctly preserve other fields of the same array element.

Per report from Onder Kalaci.  Back-patch to v11 where arrays of
domains came in.

Discussion: https://postgr.es/m/PH0PR21MB132823A46AA36F0685B7A29AD8BD9@PH0PR21MB1328.namprd21.prod.outlook.com

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/30e61a8cdc8624102ebdb1abbbb1e45457877c5c

Modified Files
--------------
src/backend/executor/execExpr.c      | 19 ++++++++++++++-----
src/test/regress/expected/domain.out | 24 ++++++++++++++++++++++++
src/test/regress/sql/domain.sql      | 17 +++++++++++++++++
3 files changed, 55 insertions(+), 5 deletions(-)



view thread (10+ messages)  latest in thread

Message-ID: <E1mctKI-0002c5-KB@gemulon.postgresql.org>
Permalink:  ../E1mctKI-0002c5-KB@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1mctKI-0002c5-KB@gemulon.postgresql.org

 · 

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-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix assignment to array of domain over composite.
  In-Reply-To: <E1mctKI-0002c5-KB@gemulon.postgresql.org>

* 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