postgresql/contrib/jsonb_plperl
Tom Lane 331b2369c0 Fix platform and Perl-version dependencies in new jsonb_plperl code.
Testing SvTYPE() directly is more fraught with problems than one might
think, because depending on context Perl might be storing a scalar value
in one of several forms, eg both numeric and string values.  This resulted
in Perl-version-dependent buildfarm test failures.  Instead use the SvTYPE
test only to distinguish non-scalar cases (AV, HV, NULL).  Disambiguate
scalars by testing SvIOK, SvNOK, then SvPOK.  This creates a preference
order for how we will resolve cases where the value is available in more
than one form, which seems fine to me.

Furthermore, because we're now dealing directly with a "double" value
in the SvNOK case, we can get rid of an inadequate and unportable
string-comparison test for infinities, and use isinf() instead.
(We do need some additional #include and "-lm" infrastructure to use
that in a contrib module, per prior experiences.)

In passing, prevent the regression test results from depending on DROP
CASCADE order; I've not seen that malfunction, but it's trouble waiting
to happen.

Discussion: https://postgr.es/m/E1f3MMJ-0006bf-B0@gemulon.postgresql.org
2018-04-04 11:28:40 -04:00
..
expected Fix platform and Perl-version dependencies in new jsonb_plperl code. 2018-04-04 11:28:40 -04:00
sql Fix platform and Perl-version dependencies in new jsonb_plperl code. 2018-04-04 11:28:40 -04:00
.gitignore Transforms for jsonb to PL/Perl 2018-04-03 09:47:18 -04:00
jsonb_plperl--1.0.sql Transforms for jsonb to PL/Perl 2018-04-03 09:47:18 -04:00
jsonb_plperl.c Fix platform and Perl-version dependencies in new jsonb_plperl code. 2018-04-04 11:28:40 -04:00
jsonb_plperl.control Transforms for jsonb to PL/Perl 2018-04-03 09:47:18 -04:00
jsonb_plperlu--1.0.sql Transforms for jsonb to PL/Perl 2018-04-03 09:47:18 -04:00
jsonb_plperlu.control Transforms for jsonb to PL/Perl 2018-04-03 09:47:18 -04:00
Makefile Fix platform and Perl-version dependencies in new jsonb_plperl code. 2018-04-04 11:28:40 -04:00