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 <[email protected]>
Reviewed-by: Greg Burd <[email protected]>
Discussion: 
https://postgr.es/m/can4czfotqxmzvupxweo4fm7+sjrpjuqu-jvyketlbxuhqgb...@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(-)

Reply via email to