summaryrefslogtreecommitdiff
path: root/contrib/jsonb_plperl/Makefile
diff options
context:
space:
mode:
authorTom Lane2018-04-04 15:28:33 +0000
committerTom Lane2018-04-04 15:28:40 +0000
commit331b2369c0ad1e51d5e50bf5dd75232e0160553a (patch)
treec4664e95d32549da837b34db0b1305773618c7c9 /contrib/jsonb_plperl/Makefile
parent3a5e0a91bb324ad2b2b1a0623a3f2e37772b43fc (diff)
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/[email protected]
Diffstat (limited to 'contrib/jsonb_plperl/Makefile')
-rw-r--r--contrib/jsonb_plperl/Makefile2
1 files changed, 2 insertions, 0 deletions
diff --git a/contrib/jsonb_plperl/Makefile b/contrib/jsonb_plperl/Makefile
index b9fe9431972..eb6d1deb7df 100644
--- a/contrib/jsonb_plperl/Makefile
+++ b/contrib/jsonb_plperl/Makefile
@@ -11,6 +11,8 @@ DATA = jsonb_plperlu--1.0.sql jsonb_plperl--1.0.sql
REGRESS = jsonb_plperl jsonb_plperlu
+SHLIB_LINK += $(filter -lm, $(LIBS))
+
ifdef USE_PGXS
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)