agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: test_extensible: Improve handling of incorrect inputs
Date: Thu, 10 Sep 2026 02:04:08 +0000
Message-ID: <E1x4U91-00000004DG6-1Kt6@gemulon.postgresql.org> (raw)

test_extensible: Improve handling of incorrect inputs

The SQL wrappers of the module relied on stringToNode(), that trusts
its input.  When specifying node strings that to not match with the
expected ExtensibleNode "TestExtNode", the module would crash.

This adds a simple set of sanity checks to check the input, ensuring
that only an ExtensibleNode "TestExtNode" goes through.  Though far
from critical, it's always nice to make these test modules not crash
when used.

Oversight in 0e944fe3579.

Author: Zsolt Parragi <zsolt.parragi@percona.com>
Reviewed-by: Greg Burd <greg@burd.me>
Discussion: https://postgr.es/m/CAN4CZFOTQXMZvuPxweO4Fm7+sjrPJUqU-JvYKETLBxuhqgbPjw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7ac0c2d058adb0aa47b7deb444c1949b84b7d781

Modified Files
--------------
.../test_extensible/expected/test_extensible.out   |  7 ++++
.../test_extensible/sql/test_extensible.sql        |  4 ++
src/test/modules/test_extensible/test_extensible.c | 45 ++++++++++++++++------
3 files changed, 44 insertions(+), 12 deletions(-)



Message-ID: <E1x4U91-00000004DG6-1Kt6@gemulon.postgresql.org>
Permalink:  ../E1x4U91-00000004DG6-1Kt6@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1x4U91-00000004DG6-1Kt6@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: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: test_extensible: Improve handling of incorrect inputs
  In-Reply-To: <E1x4U91-00000004DG6-1Kt6@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox