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

Commit61be85a

Browse files
committed
Revert "Remove reset of testtablespace from pg_regress on Windows"
This reverts commit2b2a070, that moved the reset of path"testtablespace" used by the regression tests as a path for tablespaces(via --outputdir) from pg_regress to the MSVC script vcregress.pl, asthis broke the behavior added byce5d342 to be able to safely run theregression test suite with an administrative Windows account using arestricted token.Note that before2b2a070, the code doing the reset in pg_regress.cincluded a comment telling that we had better move that out to adifferent place, leading to the mistake done in2b2a070. Fix thiscomment, and document instead that we had better never remove this code,for the sake of not breaking again the behavior we expect on Windows.Thanks to Thomas Munro and Andrew Dunstan for the discussion.Discussion:https://postgr.es/m/6d9eee97-54c8-e14a-48f7-3194e712f54f@2ndQuadrant.comDiscussion:https://postgr.es/m/CA+hUKGLiieEzfrdWxWFE+_wnXho_F5Smx972X1wEubhS7v1q9g@mail.gmail.com
1 parentff61359 commit61be85a

File tree

2 files changed

+21
-15
lines changed

2 files changed

+21
-15
lines changed

‎src/test/regress/pg_regress.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,25 @@ convert_sourcefiles_in(const char *source_subdir, const char *dest_dir, const ch
494494

495495
snprintf(testtablespace,MAXPGPATH,"%s/testtablespace",outputdir);
496496

497+
#ifdefWIN32
498+
499+
/*
500+
* On Windows only, clean out the test tablespace dir, or create it if it
501+
* doesn't exist so as it is possible to run the regression tests as a
502+
* Windows administrative user account with the restricted token obtained
503+
* when starting pg_regress. On other platforms we expect the Makefile to
504+
* take care of that.
505+
*/
506+
if (directory_exists(testtablespace))
507+
if (!rmtree(testtablespace, true))
508+
{
509+
fprintf(stderr,_("\n%s: could not remove test tablespace \"%s\"\n"),
510+
progname,testtablespace);
511+
exit(2);
512+
}
513+
make_directory(testtablespace);
514+
#endif
515+
497516
/* finally loop on each file and do the replacement */
498517
for (name=names;*name;name++)
499518
{

‎src/tools/msvc/vcregress.pl

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ sub installcheck_internal
123123
subinstallcheck
124124
{
125125
my$schedule =shift ||'serial';
126-
127-
CleanupTablespaceDirectory();
128126
installcheck_internal($schedule);
129127
return;
130128
}
@@ -145,7 +143,6 @@ sub check
145143
"--temp-instance=./tmp_check");
146144
push(@args,$maxconn)if$maxconn;
147145
push(@args,$temp_config)if$temp_config;
148-
CleanupTablespaceDirectory();
149146
system(@args);
150147
my$status =$? >> 8;
151148
exit$statusif$status;
@@ -573,8 +570,8 @@ sub upgradecheck
573570
$ENV{PGDATA} ="$data.old";
574571
my$outputdir ="$tmp_root/regress";
575572
my@EXTRA_REGRESS_OPTS = ("--outputdir=$outputdir");
576-
mkdir"$outputdir" ||die$!;
577-
CleanupTablespaceDirectory($outputdir);
573+
mkdir"$outputdir"||die$!;
574+
mkdir"$outputdir/testtablespace" ||die$!;
578575

579576
my$logdir ="$topdir/src/bin/pg_upgrade/log";
580577
rmtree($logdir);
@@ -740,16 +737,6 @@ sub InstallTemp
740737
return;
741738
}
742739

743-
subCleanupTablespaceDirectory
744-
{
745-
my$testdir =shift || getcwd();
746-
747-
my$testtablespace ="$testdir/testtablespace";
748-
749-
rmtree($testtablespace)if (-d$testtablespace);
750-
mkdir($testtablespace);
751-
}
752-
753740
subusage
754741
{
755742
printSTDERR

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp