Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit eac93e2

Browse files
committed
Remove less-portable-than-believed test case.
In commit 331b236 I added a test to see what jsonb_plperl would do with a qr{} result. Turns out the answer is Perl version dependent. That fact doesn't bother me particularly, but coping with multiple result possibilities is way more work than this test seems worth. So remove it again. Discussion: https://postgr.es/m/E1f3MMJ-0006bf-B0@gemulon.postgresql.org
1 parent 331b236 commit eac93e2

File tree

4 files changed

+2
-48
lines changed

4 files changed

+2
-48
lines changed

contrib/jsonb_plperl/expected/jsonb_plperl.out

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

42-
-- unsupported (for now)
43-
CREATE FUNCTION testRegexpToJsonb() RETURNS jsonb
44-
LANGUAGE plperl
45-
TRANSFORM FOR TYPE jsonb
46-
AS $$
47-
my $a = qr/foo/;
48-
return ($a);
49-
$$;
50-
SELECT testRegexpToJsonb();
51-
ERROR: cannot transform this Perl type to jsonb
52-
CONTEXT: PL/Perl function "testregexptojsonb"
5342
-- this revealed a bug in the original implementation
5443
CREATE FUNCTION testRegexpResultToJsonb() RETURNS jsonb
5544
LANGUAGE plperl
@@ -218,4 +207,4 @@ SELECT roundtrip('{"1": {"2": [3, 4, 5]}, "2": 3}');
218207

219208
\set VERBOSITY terse \\ -- suppress cascade details
220209
DROP EXTENSION plperl CASCADE;
221-
NOTICE: drop cascades to 7 other objects
210+
NOTICE: drop cascades to 6 other objects

contrib/jsonb_plperl/expected/jsonb_plperlu.out

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

42-
-- unsupported (for now)
43-
CREATE FUNCTION testRegexpToJsonb() RETURNS jsonb
44-
LANGUAGE plperlu
45-
TRANSFORM FOR TYPE jsonb
46-
AS $$
47-
my $a = qr/foo/;
48-
return ($a);
49-
$$;
50-
SELECT testRegexpToJsonb();
51-
ERROR: cannot transform this Perl type to jsonb
52-
CONTEXT: PL/Perl function "testregexptojsonb"
5342
-- this revealed a bug in the original implementation
5443
CREATE FUNCTION testRegexpResultToJsonb() RETURNS jsonb
5544
LANGUAGE plperlu
@@ -218,4 +207,4 @@ SELECT roundtrip('{"1": {"2": [3, 4, 5]}, "2": 3}');
218207

219208
\set VERBOSITY terse \\ -- suppress cascade details
220209
DROP EXTENSION plperlu CASCADE;
221-
NOTICE: drop cascades to 7 other objects
210+
NOTICE: drop cascades to 6 other objects

contrib/jsonb_plperl/sql/jsonb_plperl.sql

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

3636

37-
-- unsupported (for now)
38-
CREATE FUNCTION testRegexpToJsonb() RETURNS jsonb
39-
LANGUAGE plperl
40-
TRANSFORM FOR TYPE jsonb
41-
AS $$
42-
my $a = qr/foo/;
43-
return ($a);
44-
$$;
45-
46-
SELECT testRegexpToJsonb();
47-
48-
4937
-- this revealed a bug in the original implementation
5038
CREATE FUNCTION testRegexpResultToJsonb() RETURNS jsonb
5139
LANGUAGE plperl

contrib/jsonb_plperl/sql/jsonb_plperlu.sql

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

3636

37-
-- unsupported (for now)
38-
CREATE FUNCTION testRegexpToJsonb() RETURNS jsonb
39-
LANGUAGE plperlu
40-
TRANSFORM FOR TYPE jsonb
41-
AS $$
42-
my $a = qr/foo/;
43-
return ($a);
44-
$$;
45-
46-
SELECT testRegexpToJsonb();
47-
48-
4937
-- this revealed a bug in the original implementation
5038
CREATE FUNCTION testRegexpResultToJsonb() RETURNS jsonb
5139
LANGUAGE plperlu

0 commit comments

Comments
 (0)