mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
Remove jsonb_plperl test cases for Inf/NaN conversions.
It turns out that old Perl versions (before about 5.10) don't have any very reliable way to generate Inf or NaN numeric values. Getting around that would require way more work than is really justified to test the code involved, so let's just drop these new test cases. Discussion: https://postgr.es/m/28585.1525131438@sss.pgh.pa.us
This commit is contained in:
@ -34,28 +34,6 @@ $$;
|
||||
SELECT testSVToJsonb();
|
||||
|
||||
|
||||
CREATE FUNCTION testInf() RETURNS jsonb
|
||||
LANGUAGE plperl
|
||||
TRANSFORM FOR TYPE jsonb
|
||||
AS $$
|
||||
$val = 9**9**9; # we assume this will overflow to +Inf
|
||||
return $val;
|
||||
$$;
|
||||
|
||||
SELECT testInf();
|
||||
|
||||
|
||||
CREATE FUNCTION testNaN() RETURNS jsonb
|
||||
LANGUAGE plperl
|
||||
TRANSFORM FOR TYPE jsonb
|
||||
AS $$
|
||||
$val = sin(9**9**9); # we assume sin(inf) will yield NaN
|
||||
return $val;
|
||||
$$;
|
||||
|
||||
SELECT testNaN();
|
||||
|
||||
|
||||
-- this revealed a bug in the original implementation
|
||||
CREATE FUNCTION testRegexpResultToJsonb() RETURNS jsonb
|
||||
LANGUAGE plperl
|
||||
|
@ -34,28 +34,6 @@ $$;
|
||||
SELECT testSVToJsonb();
|
||||
|
||||
|
||||
CREATE FUNCTION testInf() RETURNS jsonb
|
||||
LANGUAGE plperlu
|
||||
TRANSFORM FOR TYPE jsonb
|
||||
AS $$
|
||||
$val = 9**9**9; # we assume this will overflow to +Inf
|
||||
return $val;
|
||||
$$;
|
||||
|
||||
SELECT testInf();
|
||||
|
||||
|
||||
CREATE FUNCTION testNaN() RETURNS jsonb
|
||||
LANGUAGE plperlu
|
||||
TRANSFORM FOR TYPE jsonb
|
||||
AS $$
|
||||
$val = sin(9**9**9); # we assume sin(inf) will yield NaN
|
||||
return $val;
|
||||
$$;
|
||||
|
||||
SELECT testNaN();
|
||||
|
||||
|
||||
-- this revealed a bug in the original implementation
|
||||
CREATE FUNCTION testRegexpResultToJsonb() RETURNS jsonb
|
||||
LANGUAGE plperlu
|
||||
|
Reference in New Issue
Block a user