pgsql: test_extensible: Improve handling of incorrect inputs - Mailing list pgsql-committers

From Michael Paquier
Subject pgsql: test_extensible: Improve handling of incorrect inputs
Date
Msg-id E1x4U91-00000004DG6-1Kt6@gemulon.postgresql.org
Whole thread
List pgsql-committers
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(-)


pgsql-committers by date:

Previous
From: Nathan Bossart
Date:
Subject: pgsql: Fix hangs in COPY FROM (FORMAT text).
Next
From: Michael Paquier
Date:
Subject: pgsql: test_bitmapset: Improve handling of incorrect inputs