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

Commitbb5a217

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 parent805730d commitbb5a217

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
@@ -573,8 +573,8 @@ DO $$ open my $fh, "</nonesuch"; $$ LANGUAGE plperl;
573573
ERROR: 'open' trapped by operation mask at line 1.
574574
CONTEXT: PL/Perl anonymous code block
575575
-- check that eval is allowed and eval'd restricted ops are caught
576-
DO $$ eval q{chdir '.'}; warn "Caught: $@"; $$ LANGUAGE plperl;
577-
WARNING: Caught: 'chdir' trapped by operation mask at line2.
576+
DO $$ eval q{chdir '.';}; warn "Caught: $@"; $$ LANGUAGE plperl;
577+
WARNING: Caught: 'chdir' trapped by operation mask at line1.
578578
CONTEXT: PL/Perl anonymous code block
579579
-- check that compiling do (dofile opcode) is allowed
580580
-- 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
-- Avoid need for custom_variable_classes = '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
@@ -373,7 +373,7 @@ DO $$ qx("/nonesuch"); $$ LANGUAGE plperl;
373373
DO $$ open my $fh,"</nonesuch"; $$ LANGUAGE plperl;
374374

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

378378
-- check that compiling do (dofile opcode) is allowed
379379
-- 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
-- Avoid need for custom_variable_classes = '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