Re: jsonb_plperl bug - Mailing list pgsql-hackers

From Tom Lane
Subject Re: jsonb_plperl bug
Date
Msg-id 32324.1564785590@sss.pgh.pa.us
Whole thread Raw
In response to jsonb_plperl bug  (Ivan Panchenko <wao@mail.ru>)
Responses Re[2]: jsonb_plperl bug  (Ivan Panchenko <wao@mail.ru>)
List pgsql-hackers
=?UTF-8?B?SXZhbiBQYW5jaGVua28=?= <wao@mail.ru> writes:
> I have found a bug in jsonb_plperl extension. A possible fix is proposed below.
> ...
> +                /* SVt_PV without POK flag is also NULL */
> +                if(SvTYPE(in) == SVt_PV)

Ugh.  Doesn't Perl provide some saner way to determine the type of a SV?

The core code seems to think that SvOK() is a sufficient test for an
undef.  Should we be doing that before the switch, perhaps?

(My underlying concern here is mostly about whether we have other
similar bugs.  There are a lot of places checking SvTYPE.)

            regards, tom lane



pgsql-hackers by date:

Previous
From: Ian Barwick
Date:
Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions
Next
From: Peter Geoghegan
Date:
Subject: Re: The unused_oids script should have a reminder to use the8000-8999 OID range