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

Commit035a5e1

Browse files
committed
Add semicolons to eval'd strings to hide a minor Perl behavioral change.
"eval q{foo}" used to complain that the error was on line 2 of the eval'dstring, because eval internally tacked on "\n;" so that the end of theerroneous command was indeed on line 2. But as of Perl 5.18 it moresanely says that the error is on line 1. To avoid Perl-version-dependentregression test results, use "eval q{foo;}" instead in the two placeswhere this matters. Per buildfarm.Since people might try to use newer Perl versions with older PG releases,back-patch as far as 9.0 where these test cases were added.
1 parent1538628 commit035a5e1

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

‎src/pl/plperl/expected/plperl.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,8 +626,8 @@ DO $$ open my $fh, "</nonesuch"; $$ LANGUAGE plperl;
626626
ERROR: 'open' trapped by operation mask at line 1.
627627
CONTEXT: PL/Perl anonymous code block
628628
-- check that eval is allowed and eval'd restricted ops are caught
629-
DO $$ eval q{chdir '.'}; warn "Caught: $@"; $$ LANGUAGE plperl;
630-
WARNING: Caught: 'chdir' trapped by operation mask at line2.
629+
DO $$ eval q{chdir '.';}; warn "Caught: $@"; $$ LANGUAGE plperl;
630+
WARNING: Caught: 'chdir' trapped by operation mask at line1.
631631
CONTEXT: PL/Perl anonymous code block
632632
-- check that compiling do (dofile opcode) is allowed
633633
-- but that executing it for a file not already loaded (via require) dies
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
-- test plperl.on_plperl_init errors are fatal
22
-- This test tests setting on_plperl_init after loading plperl
33
LOAD 'plperl';
4-
SET SESSION plperl.on_plperl_init = ' system("/nonesuch") ';
4+
SET SESSION plperl.on_plperl_init = ' system("/nonesuch"); ';
55
SHOW plperl.on_plperl_init;
6-
plperl.on_plperl_init
7-
-----------------------
8-
system("/nonesuch")
6+
plperl.on_plperl_init
7+
------------------------
8+
system("/nonesuch");
99
(1 row)
1010

1111
DO $$ warn 42 $$ language plperl;
12-
ERROR: 'system' trapped by operation mask at line2.
12+
ERROR: 'system' trapped by operation mask at line1.
1313
CONTEXT: while executing plperl.on_plperl_init
1414
PL/Perl anonymous code block

‎src/pl/plperl/sql/plperl.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ DO $$ qx("/nonesuch"); $$ LANGUAGE plperl;
405405
DO $$ open my $fh,"</nonesuch"; $$ LANGUAGE plperl;
406406

407407
-- check that eval is allowed and eval'd restricted ops are caught
408-
DO $$ eval q{chdir'.'}; warn"Caught: $@"; $$ LANGUAGE plperl;
408+
DO $$ eval q{chdir'.';}; warn"Caught: $@"; $$ LANGUAGE plperl;
409409

410410
-- check that compiling do (dofile opcode) is allowed
411411
-- but that executing it for a file not already loaded (via require) dies

‎src/pl/plperl/sql/plperl_init.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
-- This test tests setting on_plperl_init after loading plperl
44
LOAD'plperl';
55

6-
SET SESSIONplperl.on_plperl_init=' system("/nonesuch")';
6+
SET SESSIONplperl.on_plperl_init=' system("/nonesuch");';
77

88
SHOWplperl.on_plperl_init;
99

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp