Re: pgsql: Prevent infinity and NaN in jsonb/plperl transform

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pgsql: Prevent infinity and NaN in jsonb/plperl transform
Дата
Msg-id 28585.1525131438@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pgsql: Prevent infinity and NaN in jsonb/plperl transform  (Andrew Dunstan <andrew.dunstan@2ndquadrant.com>)
Ответы Re: pgsql: Prevent infinity and NaN in jsonb/plperl transform  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-committers
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


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Map and unmap the shared memory block before riskingVirtualFree
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Does it help to wait before reattaching?