Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
1c5531b1
Commit
1c5531b1
authored
18 years ago
by
Tom Lane
Browse files
Options
Downloads
Patches
Plain Diff
Tweak command quoting for Windows (I'd forgotten about SYSTEMQUOTE).
parent
bcee9e8c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/regress/pg_regress.c
+12
-12
12 additions, 12 deletions
src/test/regress/pg_regress.c
with
12 additions
and
12 deletions
src/test/regress/pg_regress.c
+
12
−
12
View file @
1c5531b1
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.
1
2006/07/19 0
2:37:00
tgl Exp $
* $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.
2
2006/07/19 0
4:50:57
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -197,7 +197,7 @@ stop_postmaster(void)
...
@@ -197,7 +197,7 @@ stop_postmaster(void)
char
buf
[
MAXPGPATH
*
2
];
char
buf
[
MAXPGPATH
*
2
];
snprintf
(
buf
,
sizeof
(
buf
),
snprintf
(
buf
,
sizeof
(
buf
),
"
\"
%s/pg_ctl
\"
stop -D
\"
%s/data
\"
-s -m fast"
,
SYSTEMQUOTE
"
\"
%s/pg_ctl
\"
stop -D
\"
%s/data
\"
-s -m fast"
SYSTEMQUOTE
,
bindir
,
temp_install
);
bindir
,
temp_install
);
system
(
buf
);
/* ignore exit status */
system
(
buf
);
/* ignore exit status */
postmaster_running
=
false
;
postmaster_running
=
false
;
...
@@ -589,7 +589,7 @@ psql_command(const char *database, const char *query, ...)
...
@@ -589,7 +589,7 @@ psql_command(const char *database, const char *query, ...)
/* And now we can build and execute the shell command */
/* And now we can build and execute the shell command */
snprintf
(
psql_cmd
,
sizeof
(
psql_cmd
),
snprintf
(
psql_cmd
,
sizeof
(
psql_cmd
),
"
\"
%s/psql
\"
-X -c
\"
%s
\"
\"
%s
\"
"
,
SYSTEMQUOTE
"
\"
%s/psql
\"
-X -c
\"
%s
\"
\"
%s
\"
"
SYSTEMQUOTE
,
bindir
,
query_escaped
,
database
);
bindir
,
query_escaped
,
database
);
if
(
system
(
psql_cmd
)
!=
0
)
if
(
system
(
psql_cmd
)
!=
0
)
...
@@ -676,7 +676,7 @@ psql_start_test(const char *testname)
...
@@ -676,7 +676,7 @@ psql_start_test(const char *testname)
outputdir
,
testname
);
outputdir
,
testname
);
snprintf
(
psql_cmd
,
sizeof
(
psql_cmd
),
snprintf
(
psql_cmd
,
sizeof
(
psql_cmd
),
"
\"
%s/psql
\"
-X -a -q -d
\"
%s
\"
<
\"
%s
\"
>
\"
%s
\"
2>&1"
,
SYSTEMQUOTE
"
\"
%s/psql
\"
-X -a -q -d
\"
%s
\"
<
\"
%s
\"
>
\"
%s
\"
2>&1"
SYSTEMQUOTE
,
bindir
,
dbname
,
infile
,
outfile
);
bindir
,
dbname
,
infile
,
outfile
);
pid
=
spawn_process
(
psql_cmd
);
pid
=
spawn_process
(
psql_cmd
);
...
@@ -819,7 +819,7 @@ results_differ(const char *testname)
...
@@ -819,7 +819,7 @@ results_differ(const char *testname)
/* OK, run the diff */
/* OK, run the diff */
snprintf
(
cmd
,
sizeof
(
cmd
),
snprintf
(
cmd
,
sizeof
(
cmd
),
"diff %s
\"
%s
\"
\"
%s
\"
>
\"
%s
\"
"
,
SYSTEMQUOTE
"diff %s
\"
%s
\"
\"
%s
\"
>
\"
%s
\"
"
SYSTEMQUOTE
,
basic_diff_opts
,
expectfile
,
resultsfile
,
diff
);
basic_diff_opts
,
expectfile
,
resultsfile
,
diff
);
r
=
system
(
cmd
);
r
=
system
(
cmd
);
if
(
!
WIFEXITED
(
r
)
||
WEXITSTATUS
(
r
)
>
1
)
if
(
!
WIFEXITED
(
r
)
||
WEXITSTATUS
(
r
)
>
1
)
...
@@ -848,7 +848,7 @@ results_differ(const char *testname)
...
@@ -848,7 +848,7 @@ results_differ(const char *testname)
continue
;
continue
;
snprintf
(
cmd
,
sizeof
(
cmd
),
snprintf
(
cmd
,
sizeof
(
cmd
),
"diff %s
\"
%s
\"
\"
%s
\"
>
\"
%s
\"
"
,
SYSTEMQUOTE
"diff %s
\"
%s
\"
\"
%s
\"
>
\"
%s
\"
"
SYSTEMQUOTE
,
basic_diff_opts
,
expectfile
,
resultsfile
,
diff
);
basic_diff_opts
,
expectfile
,
resultsfile
,
diff
);
r
=
system
(
cmd
);
r
=
system
(
cmd
);
if
(
!
WIFEXITED
(
r
)
||
WEXITSTATUS
(
r
)
>
1
)
if
(
!
WIFEXITED
(
r
)
||
WEXITSTATUS
(
r
)
>
1
)
...
@@ -878,7 +878,7 @@ results_differ(const char *testname)
...
@@ -878,7 +878,7 @@ results_differ(const char *testname)
* we append to the diffs summary file.
* we append to the diffs summary file.
*/
*/
snprintf
(
cmd
,
sizeof
(
cmd
),
snprintf
(
cmd
,
sizeof
(
cmd
),
"diff %s
\"
%s
\"
\"
%s
\"
>>
\"
%s
\"
"
,
SYSTEMQUOTE
"diff %s
\"
%s
\"
\"
%s
\"
>>
\"
%s
\"
"
SYSTEMQUOTE
,
pretty_diff_opts
,
best_expect_file
,
resultsfile
,
difffilename
);
pretty_diff_opts
,
best_expect_file
,
resultsfile
,
difffilename
);
r
=
system
(
cmd
);
r
=
system
(
cmd
);
if
(
!
WIFEXITED
(
r
)
||
WEXITSTATUS
(
r
)
>
1
)
if
(
!
WIFEXITED
(
r
)
||
WEXITSTATUS
(
r
)
>
1
)
...
@@ -1391,8 +1391,8 @@ main(int argc, char *argv[])
...
@@ -1391,8 +1391,8 @@ main(int argc, char *argv[])
/* "make install" */
/* "make install" */
snprintf
(
buf
,
sizeof
(
buf
),
snprintf
(
buf
,
sizeof
(
buf
),
"
\"
%s
\"
-C
\"
%s
\"
DESTDIR=
\"
%s/install
\"
install with_perl=no with_python=no >
\"
%s/log/install.log
\"
2>&1"
,
SYSTEMQUOTE
"
\"
%s
\"
-C
\"
%s
\"
DESTDIR=
\"
%s/install
\"
install with_perl=no with_python=no >
\"
%s/log/install.log
\"
2>&1"
SYSTEMQUOTE
,
makeprog
,
top_builddir
,
temp_install
,
outputdir
);
makeprog
,
top_builddir
,
temp_install
,
outputdir
);
if
(
system
(
buf
))
if
(
system
(
buf
))
{
{
fprintf
(
stderr
,
_
(
"
\n
%s: installation failed
\n
Examine %s/log/install.log for the reason.
\n
"
),
progname
,
outputdir
);
fprintf
(
stderr
,
_
(
"
\n
%s: installation failed
\n
Examine %s/log/install.log for the reason.
\n
"
),
progname
,
outputdir
);
...
@@ -1402,7 +1402,7 @@ main(int argc, char *argv[])
...
@@ -1402,7 +1402,7 @@ main(int argc, char *argv[])
/* initdb */
/* initdb */
header
(
_
(
"initializing database system"
));
header
(
_
(
"initializing database system"
));
snprintf
(
buf
,
sizeof
(
buf
),
snprintf
(
buf
,
sizeof
(
buf
),
"
\"
%s/initdb
\"
-D
\"
%s/data
\"
-L
\"
%s
\"
--noclean %s %s >
\"
%s/log/initdb.log
\"
2>&1"
,
SYSTEMQUOTE
"
\"
%s/initdb
\"
-D
\"
%s/data
\"
-L
\"
%s
\"
--noclean %s %s >
\"
%s/log/initdb.log
\"
2>&1"
SYSTEMQUOTE
,
bindir
,
temp_install
,
datadir
,
bindir
,
temp_install
,
datadir
,
debug
?
"--debug"
:
""
,
debug
?
"--debug"
:
""
,
nolocale
?
"--no-locale"
:
""
,
nolocale
?
"--no-locale"
:
""
,
...
@@ -1418,7 +1418,7 @@ main(int argc, char *argv[])
...
@@ -1418,7 +1418,7 @@ main(int argc, char *argv[])
*/
*/
header
(
_
(
"starting postmaster"
));
header
(
_
(
"starting postmaster"
));
snprintf
(
buf
,
sizeof
(
buf
),
snprintf
(
buf
,
sizeof
(
buf
),
"
\"
%s/postmaster
\"
-D
\"
%s/data
\"
-F %s -c
\"
listen_addresses=%s
\"
>
\"
%s/log/postmaster.log
\"
2>&1"
,
SYSTEMQUOTE
"
\"
%s/postmaster
\"
-D
\"
%s/data
\"
-F %s -c
\"
listen_addresses=%s
\"
>
\"
%s/log/postmaster.log
\"
2>&1"
SYSTEMQUOTE
,
bindir
,
temp_install
,
bindir
,
temp_install
,
debug
?
"-d 5"
:
""
,
debug
?
"-d 5"
:
""
,
hostname
?
hostname
:
""
,
hostname
?
hostname
:
""
,
...
@@ -1445,7 +1445,7 @@ main(int argc, char *argv[])
...
@@ -1445,7 +1445,7 @@ main(int argc, char *argv[])
* wait forever, however.
* wait forever, however.
*/
*/
snprintf
(
buf
,
sizeof
(
buf
),
snprintf
(
buf
,
sizeof
(
buf
),
"
\"
%s/psql
\"
-X postgres <%s 2>%s"
,
SYSTEMQUOTE
"
\"
%s/psql
\"
-X postgres <%s 2>%s"
SYSTEMQUOTE
,
bindir
,
DEVNULL
,
DEVNULL
);
bindir
,
DEVNULL
,
DEVNULL
);
for
(
i
=
0
;
i
<
60
;
i
++
)
for
(
i
=
0
;
i
<
60
;
i
++
)
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment