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

Commit9ebe6fd

Browse files
committed
Skip pg_baseback long filename test if path too long on Windows
On Windows, it's sometimes difficult to create a file with a path longerthan 255 chars, and if it can be created it might not be seen by thearchiver. This can be triggered by the test for tar backups withfilenames greater than 100 bytes. So we skip that test if the path wouldexceed 255.Backpatch to all live branches.Reviewed by Daniel GustafssonDiscussion:https://postgr.es/m/666ac55b-3400-fb2c-2cea-0281bf36a53c@dunslane.net
1 parentc50b869 commit9ebe6fd

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

‎src/bin/pg_basebackup/t/010_pg_basebackup.pl

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -199,17 +199,23 @@
199199
['pg_basebackup','-D',"$tempdir/backup_foo",'-Fp',"-Tfoo" ],
200200
'-T with invalid format fails');
201201

202-
# Tar format doesn't support filenames longer than 100 bytes.
203202
my$superlongname ="superlongname_" . ("x"x100);
204-
my$superlongpath ="$pgdata/$superlongname";
203+
# Tar format doesn't support filenames longer than 100 bytes.
204+
SKIP:
205+
{
206+
my$superlongpath ="$pgdata/$superlongname";
205207

206-
openmy$file,'>',"$superlongpath"
207-
ordie"unable to create file$superlongpath";
208-
close$file;
209-
$node->command_fails(
210-
['pg_basebackup','-D',"$tempdir/tarbackup_l1",'-Ft' ],
211-
'pg_basebackup tar with long name fails');
212-
unlink"$pgdata/$superlongname";
208+
skip"File path too long", 1
209+
if$windows_os &&length($superlongpath) > 255;
210+
211+
openmy$file,'>',"$superlongpath"
212+
ordie"unable to create file$superlongpath";
213+
close$file;
214+
$node->command_fails(
215+
['pg_basebackup','-D',"$tempdir/tarbackup_l1",'-Ft' ],
216+
'pg_basebackup tar with long name fails');
217+
unlink"$superlongpath";
218+
}
213219

214220
# The following tests test symlinks. Windows doesn't have symlinks, so
215221
# skip on Windows.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp