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

Commit9ad21a6

Browse files
committed
Don't use an Msys virtual path to create a tablespace
The new unlogged_reinit recovery tests create a new tablespace usingTestLib.pm's tempdir. However, on msys that function returns a virtualpath that isn't understood by Postgres. Here we add a new function toTestLib.pm to turn such a path into a real path on the underlying filesystem, and use it in the new test to create the tablespace. The newfunction is essentially a NOOP everywhere but msys.
1 parent6fbd5cc commit9ad21a6

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

‎src/test/perl/TestLib.pm

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use strict;
1111
use warnings;
1212

1313
use Config;
14+
use Cwd;
1415
use Exporter'import';
1516
use File::Basename;
1617
use File::Spec;
@@ -158,6 +159,23 @@ sub tempdir_short
158159
return File::Temp::tempdir(CLEANUP=> 1);
159160
}
160161

162+
# Return the real directory for a virtual path directory under msys.
163+
# The directory must exist. If it's not an existing directory or we're
164+
# not under msys, return the input argument unchanged.
165+
subreal_dir
166+
{
167+
my$dir ="$_[0]";
168+
return$dirunless-d$dir;
169+
return$dirunless$Config{osname}eq'msys';
170+
my$here = cwd;
171+
chdir$dir;
172+
# this odd way of calling 'pwd -W' is the only way that seems to work.
173+
$dir =qx{sh -c "pwd -W"};
174+
chomp$dir;
175+
chdir$here;
176+
return$dir;
177+
}
178+
161179
subsystem_log
162180
{
163181
print("# Running:" .join("",@_) ."\n");

‎src/test/recovery/t/014_unlogged_reinit.pl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@
3030

3131
my$tablespaceDir = TestLib::tempdir;
3232

33+
my$realTSDir = TestLib::real_dir($tablespaceDir);
34+
3335
$node->safe_psql('postgres',
34-
"CREATE TABLESPACE ts1 LOCATION '$tablespaceDir'");
36+
"CREATE TABLESPACE ts1 LOCATION '$realTSDir'");
3537
$node->safe_psql('postgres',
3638
'CREATE UNLOGGED TABLE ts1_unlogged (id int) TABLESPACE ts1');
3739

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp