Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6594ee2

Browse files
committed
Remove jsonb_plperl test cases for Inf/NaN conversions.
It turns out that old Perl versions (before about 5.10) don't have anyvery reliable way to generate Inf or NaN numeric values. Getting aroundthat would require way more work than is really justified to test thecode involved, so let's just drop these new test cases.Discussion:https://postgr.es/m/28585.1525131438@sss.pgh.pa.us
1 parentbcbf234 commit6594ee2

File tree

4 files changed

+2
-86
lines changed

4 files changed

+2
-86
lines changed

‎contrib/jsonb_plperl/expected/jsonb_plperl.out

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,26 +39,6 @@ SELECT testSVToJsonb();
3939
1
4040
(1 row)
4141

42-
CREATE FUNCTION testInf() RETURNS jsonb
43-
LANGUAGE plperl
44-
TRANSFORM FOR TYPE jsonb
45-
AS $$
46-
$val = 9**9**9; # we assume this will overflow to +Inf
47-
return $val;
48-
$$;
49-
SELECT testInf();
50-
ERROR: cannot convert infinity to jsonb
51-
CONTEXT: PL/Perl function "testinf"
52-
CREATE FUNCTION testNaN() RETURNS jsonb
53-
LANGUAGE plperl
54-
TRANSFORM FOR TYPE jsonb
55-
AS $$
56-
$val = sin(9**9**9); # we assume sin(inf) will yield NaN
57-
return $val;
58-
$$;
59-
SELECT testNaN();
60-
ERROR: cannot convert NaN to jsonb
61-
CONTEXT: PL/Perl function "testnan"
6242
-- this revealed a bug in the original implementation
6343
CREATE FUNCTION testRegexpResultToJsonb() RETURNS jsonb
6444
LANGUAGE plperl
@@ -227,4 +207,4 @@ SELECT roundtrip('{"1": {"2": [3, 4, 5]}, "2": 3}');
227207

228208
\set VERBOSITY terse \\ -- suppress cascade details
229209
DROP EXTENSION plperl CASCADE;
230-
NOTICE: drop cascades to8 other objects
210+
NOTICE: drop cascades to6 other objects

‎contrib/jsonb_plperl/expected/jsonb_plperlu.out

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,26 +39,6 @@ SELECT testSVToJsonb();
3939
1
4040
(1 row)
4141

42-
CREATE FUNCTION testInf() RETURNS jsonb
43-
LANGUAGE plperlu
44-
TRANSFORM FOR TYPE jsonb
45-
AS $$
46-
$val = 9**9**9; # we assume this will overflow to +Inf
47-
return $val;
48-
$$;
49-
SELECT testInf();
50-
ERROR: cannot convert infinity to jsonb
51-
CONTEXT: PL/Perl function "testinf"
52-
CREATE FUNCTION testNaN() RETURNS jsonb
53-
LANGUAGE plperlu
54-
TRANSFORM FOR TYPE jsonb
55-
AS $$
56-
$val = sin(9**9**9); # we assume sin(inf) will yield NaN
57-
return $val;
58-
$$;
59-
SELECT testNaN();
60-
ERROR: cannot convert NaN to jsonb
61-
CONTEXT: PL/Perl function "testnan"
6242
-- this revealed a bug in the original implementation
6343
CREATE FUNCTION testRegexpResultToJsonb() RETURNS jsonb
6444
LANGUAGE plperlu
@@ -227,4 +207,4 @@ SELECT roundtrip('{"1": {"2": [3, 4, 5]}, "2": 3}');
227207

228208
\set VERBOSITY terse \\ -- suppress cascade details
229209
DROP EXTENSION plperlu CASCADE;
230-
NOTICE: drop cascades to8 other objects
210+
NOTICE: drop cascades to6 other objects

‎contrib/jsonb_plperl/sql/jsonb_plperl.sql

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,6 @@ $$;
3434
SELECT testSVToJsonb();
3535

3636

37-
CREATEFUNCTIONtestInf() RETURNS jsonb
38-
LANGUAGE plperl
39-
TRANSFORM FOR TYPE jsonb
40-
AS $$
41-
$val=9**9**9;# we assume this will overflow to +Inf
42-
return $val;
43-
$$;
44-
45-
SELECT testInf();
46-
47-
48-
CREATEFUNCTIONtestNaN() RETURNS jsonb
49-
LANGUAGE plperl
50-
TRANSFORM FOR TYPE jsonb
51-
AS $$
52-
$val= sin(9**9**9);# we assume sin(inf) will yield NaN
53-
return $val;
54-
$$;
55-
56-
SELECT testNaN();
57-
58-
5937
-- this revealed a bug in the original implementation
6038
CREATEFUNCTIONtestRegexpResultToJsonb() RETURNS jsonb
6139
LANGUAGE plperl

‎contrib/jsonb_plperl/sql/jsonb_plperlu.sql

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,6 @@ $$;
3434
SELECT testSVToJsonb();
3535

3636

37-
CREATEFUNCTIONtestInf() RETURNS jsonb
38-
LANGUAGE plperlu
39-
TRANSFORM FOR TYPE jsonb
40-
AS $$
41-
$val=9**9**9;# we assume this will overflow to +Inf
42-
return $val;
43-
$$;
44-
45-
SELECT testInf();
46-
47-
48-
CREATEFUNCTIONtestNaN() RETURNS jsonb
49-
LANGUAGE plperlu
50-
TRANSFORM FOR TYPE jsonb
51-
AS $$
52-
$val= sin(9**9**9);# we assume sin(inf) will yield NaN
53-
return $val;
54-
$$;
55-
56-
SELECT testNaN();
57-
58-
5937
-- this revealed a bug in the original implementation
6038
CREATEFUNCTIONtestRegexpResultToJsonb() RETURNS jsonb
6139
LANGUAGE plperlu

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp