Re: Re[2]: jsonb_plperl bug - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Re[2]: jsonb_plperl bug
Date
Msg-id 12780.1564942119@sss.pgh.pa.us
Whole thread Raw
In response to Re[2]: jsonb_plperl bug  (Ivan Panchenko <wao@mail.ru>)
List pgsql-hackers
=?UTF-8?B?SXZhbiBQYW5jaGVua28=?= <wao@mail.ru> writes:
> Tom Lane <tgl@sss.pgh.pa.us>:
>> The core code seems to think that SvOK() is a sufficient test for an
>> undef.  Should we be doing that before the switch, perhaps?

> Thank you, Tom. Yes, there is a solution with SvOK(), please see the attached patch.

Yeah, that looks cleaner.  I suppose we could get rid of the switch()
but it would result in a bigger diff for not much reason.

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

> I looked through plperl.c, but found no similar cases of checking SvTYPE.

Yeah, at least there are no other places explicitly checking for
SVt_NULL.

Pushed with minor fiddling with the test case.  Thanks!

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: pglz performance
Next
From: Michail Nikolaev
Date:
Subject: Re: Optimize single tuple fetch from nbtree index