1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-31 10:30:33 +03:00

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'd
string, because eval internally tacked on "\n;" so that the end of the
erroneous command was indeed on line 2.  But as of Perl 5.18 it more
sanely says that the error is on line 1.  To avoid Perl-version-dependent
regression test results, use "eval q{foo;}" instead in the two places
where 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.
This commit is contained in:
Tom Lane
2013-06-03 14:19:26 -04:00
parent 15386281a6
commit 035a5e1e8c
4 changed files with 9 additions and 9 deletions

View File

@@ -405,7 +405,7 @@ DO $$ qx("/nonesuch"); $$ LANGUAGE plperl;
DO $$ open my $fh, "</nonesuch"; $$ LANGUAGE plperl;
-- check that eval is allowed and eval'd restricted ops are caught
DO $$ eval q{chdir '.'}; warn "Caught: $@"; $$ LANGUAGE plperl;
DO $$ eval q{chdir '.';}; warn "Caught: $@"; $$ LANGUAGE plperl;
-- check that compiling do (dofile opcode) is allowed
-- but that executing it for a file not already loaded (via require) dies