From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix handling of "undef" in contrib/jsonb_plperl.
Date: Sun, 04 Aug 2019 18:05:54 +0000
Message-ID: <E1huKtG-0006BN-DR@gemulon.postgresql.org> (raw)
Fix handling of "undef" in contrib/jsonb_plperl.
Perl has multiple internal representations of "undef", and just
testing for SvTYPE(x) == SVt_NULL doesn't recognize all of them,
leading to "cannot transform this Perl type to jsonb" errors.
Use the approved test SvOK() instead.
Report and patch by Ivan Panchenko. Back-patch to v11 where
this module was added.
Discussion: https://postgr.es/m/1564783533.324795401@f193.i.mail.ru
Branch
------
REL_12_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/df521ab79547b82471126e54e9dc7fead4a5a4fb
Modified Files
--------------
contrib/jsonb_plperl/expected/jsonb_plperl.out | 22 +++++++++++++++++++++-
contrib/jsonb_plperl/expected/jsonb_plperlu.out | 22 +++++++++++++++++++++-
contrib/jsonb_plperl/jsonb_plperl.c | 10 +++++-----
contrib/jsonb_plperl/sql/jsonb_plperl.sql | 13 +++++++++++++
contrib/jsonb_plperl/sql/jsonb_plperlu.sql | 13 +++++++++++++
5 files changed, 73 insertions(+), 7 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: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Fix handling of "undef" in contrib/jsonb_plperl.
In-Reply-To: <E1huKtG-0006BN-DR@gemulon.postgresql.org>
References: <E1huKtG-0006BN-DR@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