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

Commitc3e4cba

Browse files
committed
Msys2 tweaks for pg_validatebackup corruption test
1. Tell Msys2 not to mangle the tablespace map parameter2. If rmdir doesn't work, fall back to trying unlink on the entry in pg_tblspc.Discussion:https://postgr.es/m/7330a7c7-ce5f-9769-39a1-bdb0b32bb4a6@2ndQuadrant.com
1 parentf45b8e5 commitc3e4cba

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

‎src/bin/pg_validatebackup/t/003_corruption.pl

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
# Include a user-defined tablespace in the hopes of detecting problems in that
1717
# area.
1818
my$source_ts_path = TestLib::perl2host(TestLib::tempdir_short());
19+
my$source_ts_prefix =$source_ts_path;
20+
$source_ts_prefix =~s!(^[A-Z]:/[^/]*)/.*!$1!;
21+
1922
$master->safe_psql('postgres',<<EOM);
2023
CREATE TABLE x1 (a int);
2124
INSERT INTO x1 VALUES (111);
@@ -105,6 +108,10 @@
105108
# Take a backup and check that it validates OK.
106109
my$backup_path =$master->backup_dir .'/' .$name;
107110
my$backup_ts_path = TestLib::perl2host(TestLib::tempdir_short());
111+
# The tablespace map parameter confuses Msys2, which tries to mangle
112+
# it. Tell it not to.
113+
# See https://www.msys2.org/wiki/Porting/#filesystem-namespaces
114+
local$ENV{MSYS2_ARG_CONV_EXCL} =$source_ts_prefix;
108115
$master->command_ok(['pg_basebackup','-D',$backup_path,'--no-sync',
109116
'-T',"${source_ts_path}=${backup_ts_path}"],
110117
"base backup ok");
@@ -179,7 +186,14 @@ sub mutilate_missing_tablespace
179186
my$pathname ="$backup_path/pg_tblspc/$tsoid";
180187
if ($windows_os)
181188
{
182-
rmdir($pathname) ||die"$pathname:$!";
189+
# rmdir works on some windows setups, unlink on others.
190+
# Instead of trying to implement precise rules, just try one and then
191+
# the other.
192+
unless (rmdir($pathname))
193+
{
194+
my$err =$!;
195+
unlink($pathname) ||die"$pathname: rmdir:$err, unlink:$!";
196+
}
183197
}
184198
else
185199
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp