index 25c2dff43730a418e8c1a98782d70e33d520fdba..1eb4cae199fe09d0ae7974f5a27dc6de1a7ffa79 100644 (file)
use warnings;
use PostgresNode;
use TestLib;
+
+use File::Basename;
use FindBin;
use Test::More tests => 1;
@@ -23,12 +25,17 @@ my $node_primary = get_new_node('primary');
# get there.
$node_primary->init(allows_streaming => 1, has_archiving => 1);
my $perlbin = $^X;
-$perlbin =~ s{\\}{\\\\}g if ($TestLib::windows_os);
+if ($^O eq 'msys')
+{
+ $perlbin = TestLib::perl2host(dirname($^X)) . '\\' . basename($^X);
+}
+$perlbin =~ s!\\!/!g if $TestLib::windows_os;
my $archivedir_primary = $node_primary->archive_dir;
$node_primary->append_conf('postgresql.conf', qq(
-archive_command = '$perlbin "$FindBin::RealBin/cp_history_files" "%p" "$archivedir_primary/%f"'
+archive_command = '"$perlbin" "$FindBin::RealBin/cp_history_files" "%p" "$archivedir_primary/%f"'
wal_keep_size=128MB
));
+local $ENV{PERL_BADLANG}=0;
$node_primary->start;
# Take backup from primary
@@ -74,7 +81,8 @@ $node_standby->safe_psql('postgres', 'SELECT pg_switch_wal()');
# WAL segment, this is enough to guarantee that the history file was
# archived.
my $archive_wait_query =
- "SELECT '$walfile_to_be_archived' <= last_archived_wal FROM pg_stat_archiver;";
+ "SELECT coalesce('$walfile_to_be_archived' <= last_archived_wal, false) " .
+ "FROM pg_stat_archiver";
$node_standby->poll_query_until('postgres', $archive_wait_query)
or die "Timed out while waiting for WAL segment to be archived";
my $last_archived_wal_file = $walfile_to_be_archived;
index cfeea41e5b918ed51fe62878558c2f5401de4e32..66f1b598fea81e70549a1a2727a822a663c10288 100644 (file)
die "wrong number of arguments" if @ARGV != 2;
my ($source, $target) = @ARGV;
exit if $source !~ /history/;
+if ($^O eq 'msys')
+{
+ # make a windows path look like an msys path if necessary
+ $source =~ s!^([A-Za-z]):!'/' . lc(1ドル)!e;
+ $source =~ s!\\!/!g;
+}
+
copy($source, $target) or die "couldn't copy $source to $target: $!";