Re: jsonb_plperl bug

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ivan Panchenko <wao(at)mail(dot)ru>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: jsonb_plperl bug
Date: 2019-08-02 22:39:50
Message-ID: 32324.1564785590@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

=?UTF-8?B?SXZhbiBQYW5jaGVua28=?= <wao(at)mail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2019-08-02 22:42:29 Re: The unused_oids script should have a reminder to use the 8000-8999 OID range
Previous Message Ian Barwick 2019-08-02 22:39:27 Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions