pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix inconsistencies in SRF checks of pg_config() and string_to_t
Date: Sat, 19 Feb 2022 05:59:45 +0000
Message-ID: <E1nLImX-000315-NU@gemulon.postgresql.org> (raw)

Fix inconsistencies in SRF checks of pg_config() and string_to_table()

The execution paths of those functions have been using a set of checks
inconsistent with any other SRF function:
- string_to_table() missed a check on expectedDesc, the tuple descriptor
expected by the caller, that should never be NULL.  Introduced in
66f1630.
- pg_config() should check for a ReturnSetInfo, and expectedDesc cannot
be NULL.  Its error messages were also inconsistent.  Introduced in
a5c43b8.

Extracted from a larger patch by the same author, in preparation for a
larger patch set aimed at refactoring the way tuplestores are created
and checked in SRF functions.

Author: Melanie Plageman
Reviewed-by: Justin Pryzby
Discussion: https://postgr.es/m/CAAKRu_azyd1Z3W_r7Ou4sorTjRCs+PxeHw1CWJeXKofkE6TuZg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/07daca53bfcad59618a9c6fad304e380cc9d2bc1

Modified Files
--------------
src/backend/utils/adt/varlena.c    |  3 ++-
src/backend/utils/misc/pg_config.c | 12 ++++++++----
2 files changed, 10 insertions(+), 5 deletions(-)



Message-ID: <E1nLImX-000315-NU@gemulon.postgresql.org>
Permalink:  ../E1nLImX-000315-NU@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nLImX-000315-NU@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 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: michael@paquier.xyz
  Subject: Re: pgsql: Fix inconsistencies in SRF checks of pg_config() and string_to_t
  In-Reply-To: <E1nLImX-000315-NU@gemulon.postgresql.org>
  References: <E1nLImX-000315-NU@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