Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fDIML-0003rS-6t for pgsql-committers@arkaria.postgresql.org; Mon, 30 Apr 2018 23:37:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fDIMJ-0002vx-5L for pgsql-committers@arkaria.postgresql.org; Mon, 30 Apr 2018 23:37:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fDIMJ-0002vo-0R for pgsql-committers@lists.postgresql.org; Mon, 30 Apr 2018 23:37:27 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fDIME-0001Sb-S6 for pgsql-committers@lists.postgresql.org; Mon, 30 Apr 2018 23:37:25 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w3UNbIhn028586; Mon, 30 Apr 2018 19:37:18 -0400 From: Tom Lane To: Andrew Dunstan cc: Peter Eisentraut , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Prevent infinity and NaN in jsonb/plperl transform In-reply-to: <213242a0-0ed8-ade6-822c-0270f7064799@2ndQuadrant.com> References: <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> Comments: In-reply-to Andrew Dunstan message dated "Mon, 30 Apr 2018 15:13:05 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28584.1525131438.1@sss.pgh.pa.us> Date: Mon, 30 Apr 2018 19:37:18 -0400 Message-ID: <28585.1525131438@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andrew Dunstan 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