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

Commit061b88c

Browse files
committed
Try again to make pg_isolation_regress work its build directory.
We can't search for the isolationtester binary until after we've setup the environment, because otherwise when find_other_exec() triesto invoke it with the -V option, it might fail for inability tolocate a working libpq. So postpone that step.Andres Freund
1 parent9cab81b commit061b88c

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

‎src/test/isolation/isolation_main.c

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212

1313
#include"pg_regress.h"
1414

15+
charsaved_argv0[MAXPGPATH];
1516
charisolation_exec[MAXPGPATH];
17+
boollooked_up_isolation_exec= false;
18+
1619
#definePG_ISOLATION_VERSIONSTR "isolationtester (PostgreSQL) " PG_VERSION "\n"
1720

1821
/*
@@ -32,6 +35,19 @@ isolation_start_test(const char *testname,
3235
charpsql_cmd[MAXPGPATH*3];
3336
size_toffset=0;
3437

38+
/* need to do the path lookup here, check isolation_init() for details */
39+
if (!looked_up_isolation_exec)
40+
{
41+
/* look for isolationtester binary */
42+
if (find_other_exec(saved_argv0,"isolationtester",
43+
PG_ISOLATION_VERSIONSTR,isolation_exec)!=0)
44+
{
45+
fprintf(stderr,_("could not find proper isolationtester binary\n"));
46+
exit(2);
47+
}
48+
looked_up_isolation_exec= true;
49+
}
50+
3551
/*
3652
* Look for files in the output dir first, consistent with a vpath search.
3753
* This is mainly to create more reasonable error messages if the file is
@@ -82,13 +98,16 @@ isolation_start_test(const char *testname,
8298
staticvoid
8399
isolation_init(intargc,char**argv)
84100
{
85-
/* look for isolationtester binary */
86-
if (find_other_exec(argv[0],"isolationtester",
87-
PG_ISOLATION_VERSIONSTR,isolation_exec)!=0)
88-
{
89-
fprintf(stderr,_("could not find proper isolationtester binary\n"));
90-
exit(2);
91-
}
101+
/*
102+
* We unfortunately cannot do the find_other_exec() lookup to find the
103+
* "isolationtester" binary here. regression_main() calls the
104+
* initialization functions before parsing the commandline arguments and
105+
* thus hasn't changed the library search path at this point which in turn
106+
* can cause the "isolationtester -V" invocation that find_other_exec()
107+
* does to fail since it's linked to libpq. So we instead copy argv[0]
108+
* and do the lookup the first time through isolation_start_test().
109+
*/
110+
strncpy(saved_argv0,argv[0],MAXPGPATH);
92111

93112
/* set default regression database name */
94113
add_stringlist_item(&dblist,"isolationtest");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp