Skip to content

Commit a3b685f

Browse files
committed
Fix pl/perl test case so it will still work under Perl 5.36.
Perl 5.36 has reclassified the warning condition that this test case used, so that the expected error fails to appear. Tweak the test so it instead exercises a case that's handled the same way in all Perl versions of interest. This appears to meet our standards for back-patching into out-of-support branches: it changes no user-visible behavior but enables testing of old branches with newer tools. Hence, back-patch as far as 9.2. Dagfinn Ilmari Mannsåker, per report from Jitka Plesníková. Discussion: https://postgr.es/m/564579.1654093326@sss.pgh.pa.us
1 parent f705503 commit a3b685f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/pl/plperl/expected/plperl.out

+3-3
Original file line numberDiff line numberDiff line change
@@ -646,9 +646,9 @@ DO $do$ use strict; my $name = "foo"; my $ref = $$name; $do$ LANGUAGE plperl;
646646
ERROR: Can't use string ("foo") as a SCALAR ref while "strict refs" in use at line 1.
647647
CONTEXT: PL/Perl anonymous code block
648648
-- check that we can "use warnings" (in this case to turn a warn into an error)
649-
-- yields "ERROR: Useless use of sort in scalar context."
650-
DO $do$ use warnings FATAL => qw(void) ; my @y; my $x = sort @y; 1; $do$ LANGUAGE plperl;
651-
ERROR: Useless use of sort in scalar context at line 1.
649+
-- yields "ERROR: Useless use of sort in void context."
650+
DO $do$ use warnings FATAL => qw(void) ; my @y; sort @y; 1; $do$ LANGUAGE plperl;
651+
ERROR: Useless use of sort in void context at line 1.
652652
CONTEXT: PL/Perl anonymous code block
653653
-- make sure functions marked as VOID without an explicit return work
654654
CREATE OR REPLACE FUNCTION myfuncs() RETURNS void AS $$

src/pl/plperl/sql/plperl.sql

+2-2
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,8 @@ DO $$ use blib; $$ LANGUAGE plperl;
420420
DO $do$ use strict; my $name = "foo"; my $ref = $$name; $do$ LANGUAGE plperl;
421421

422422
-- check that we can "use warnings" (in this case to turn a warn into an error)
423-
-- yields "ERROR: Useless use of sort in scalar context."
424-
DO $do$ use warnings FATAL => qw(void) ; my @y; my $x = sort @y; 1; $do$ LANGUAGE plperl;
423+
-- yields "ERROR: Useless use of sort in void context."
424+
DO $do$ use warnings FATAL => qw(void) ; my @y; sort @y; 1; $do$ LANGUAGE plperl;
425425

426426
-- make sure functions marked as VOID without an explicit return work
427427
CREATE OR REPLACE FUNCTION myfuncs() RETURNS void AS $$

0 commit comments

Comments
 (0)