From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Make ExecGetInsertedCols() and friends more robust and improve c
Date: Mon, 15 Feb 2021 07:31:46 +0000
Message-ID: <E1lBYME-00006X-KP@gemulon.postgresql.org> (raw)
Make ExecGetInsertedCols() and friends more robust and improve comments.
If ExecGetInsertedCols(), ExecGetUpdatedCols() or ExecGetExtraUpdatedCols()
were called with a ResultRelInfo that's not in the range table and isn't a
partition routing target, the functions would dereference a NULL pointer,
relinfo->ri_RootResultRelInfo. Such ResultRelInfos are created when firing
RI triggers in tables that are not modified directly. None of the current
callers of these functions pass such relations, so this isn't a live bug,
but let's make them more robust.
Also update comment in ResultRelInfo; after commit 6214e2b228,
ri_RangeTableIndex is zero for ResultRelInfos created for partition tuple
routing.
Noted by Coverity. Backpatch down to v11, like commit 6214e2b228.
Reviewed-by: Tom Lane, Amit Langote
Branch
------
REL_12_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/2b81444a88cc499f5d3608c5943e9a6e4b489070
Modified Files
--------------
src/backend/executor/execUtils.c | 28 +++++++++++++++++++++-------
src/include/nodes/execnodes.h | 15 +++++++++------
2 files changed, 30 insertions(+), 13 deletions(-)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: heikki.linnakangas@iki.fi
Subject: Re: pgsql: Make ExecGetInsertedCols() and friends more robust and improve c
In-Reply-To: <E1lBYME-00006X-KP@gemulon.postgresql.org>
References: <E1lBYME-00006X-KP@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