Fix handling of "undef" in contrib/jsonb_plperl.
Tom Lane <tgl@sss.pgh.pa.us>
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
Files
| Path | Change | +/− |
|---|---|---|
| contrib/jsonb_plperl/expected/jsonb_plperl.out | modified | +21 −1 |
| contrib/jsonb_plperl/expected/jsonb_plperlu.out | modified | +21 −1 |
| contrib/jsonb_plperl/jsonb_plperl.c | modified | +5 −5 |
| contrib/jsonb_plperl/sql/jsonb_plperl.sql | modified | +13 −0 |
| contrib/jsonb_plperl/sql/jsonb_plperlu.sql | modified | +13 −0 |
Discussion
- jsonb_plperl bug 4 messages · 2019-08-02 → 2019-08-04