aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2021-06-15 15:30:11 -0400
committerAndrew Dunstan <andrew@dunslane.net>2021-06-15 15:36:59 -0400
commitfb3d6b0e1aa41518857ff12534bef49503ce7575 (patch)
tree9119959788d0c5ea3239e87a4b87367ed4b0f973 /src
parent40ad7ebff6ca08a67f11108e73f6563416c8603b (diff)
downloadpostgresql-fb3d6b0e1aa41518857ff12534bef49503ce7575.tar.gz
postgresql-fb3d6b0e1aa41518857ff12534bef49503ce7575.zip
Further refinement of stuck_on_old_timeline recovery test
TestLib::perl2host can take a file argument as well as a directory argument, so that code becomes substantially simpler. Also add comments on why we're using forward slashes, and why we're setting PERL_BADLANG=0. Discussion: https://postgr.es/m/e9947bcd-20ee-027c-f0fe-01f736b7e345@dunslane.net
Diffstat (limited to 'src')
-rw-r--r--src/test/recovery/t/025_stuck_on_old_timeline.pl12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/test/recovery/t/025_stuck_on_old_timeline.pl b/src/test/recovery/t/025_stuck_on_old_timeline.pl
index 6bdbaee849e..9859c0b4976 100644
--- a/src/test/recovery/t/025_stuck_on_old_timeline.pl
+++ b/src/test/recovery/t/025_stuck_on_old_timeline.pl
@@ -24,11 +24,11 @@ my $node_primary = get_new_node('primary');
# the timeline history file reaches the archive but before any of the WAL files
# get there.
$node_primary->init(allows_streaming => 1, has_archiving => 1);
-my $perlbin = $^X;
-if ($^O eq 'msys')
-{
- $perlbin = TestLib::perl2host(dirname($^X)) . '\\' . basename($^X);
-}
+
+# Note: consistent use of forward slashes here avoids any escaping problems
+# that arise from use of backslashes. That means we need to double-quote all
+# the paths in the archive_command
+my $perlbin = TestLib::perl2host($^X);
$perlbin =~ s!\\!/!g if $TestLib::windows_os;
my $archivedir_primary = $node_primary->archive_dir;
$archivedir_primary =~ s!\\!/!g if $TestLib::windows_os;
@@ -36,6 +36,8 @@ $node_primary->append_conf('postgresql.conf', qq(
archive_command = '"$perlbin" "$FindBin::RealBin/cp_history_files" "%p" "$archivedir_primary/%f"'
wal_keep_segments=8
));
+# Make sure that Msys perl doesn't complain about difficulty in setting locale
+# when called from the archive_command.
local $ENV{PERL_BADLANG}=0;
$node_primary->start;