From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Prevent infinity and NaN in jsonb/plperl transform
Date: Mon, 30 Apr 2018 19:37:18 -0400
Message-ID: <28585.1525131438@sss.pgh.pa.us> (raw)
In-Reply-To: <213242a0-0ed8-ade6-822c-0270f7064799@2ndQuadrant.com>
References: <E1fDCX9-0005yu-7q@gemulon.postgresql.org>
<21194.1525110966@sss.pgh.pa.us>
<59e5787f-314e-6e5d-db5e-bcb6b9dbc25c@2ndquadrant.com>
<23691.1525113718@sss.pgh.pa.us>
<213242a0-0ed8-ade6-822c-0270f7064799@2ndQuadrant.com>
Andrew Dunstan <andrew.dunstan@2ndquadrant.com> writes:
> Fingers crossed we'll be OK. Looking at the perl headers on a Windows
> machine I'm doing some other stuff on, the #define is protected by an
> #ifndef. I'm always happy when my hacks can be removed :-)
Well, the early returns on that are promising, but we have another
problem: prairiedog, jacana, and probably other old BF members are
failing the new regression test cases. It appears that what the test
script assumes will produce a NaN or Inf float doesn't work in 5.8.x
perl:
$ perl -e "print 0 + 'NaN'"
0
$ perl -e "print 0 + 'Inf'"
0
I googled a bit and found these recommendations on stackoverflow:
my $inf = 9**9**9;
my $neginf = -9**9**9;
my $nan = -sin(9**9**9);
These do seem to produce the desired results, at least on the
couple of Perl versions I checked, including 5.8.3.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us, andrew.dunstan@2ndquadrant.com, peter.eisentraut@2ndquadrant.com, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Prevent infinity and NaN in jsonb/plperl transform
In-Reply-To: <28585.1525131438@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox