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

Commitf2f9e11

Browse files
committed
Reject missing database name in pg_regress and cohorts.
Writing "pg_regress --dbname= ..." led to a crash, becausewe weren't expecting there to be no database name supplied.It doesn't seem like a great idea to run regression testsin whatever is the user's default database; so rather thansupporting this case let's explicitly reject it.Per report from Xing Guo. Back-patch to all supportedbranches.Discussion:https://postgr.es/m/CACpMh+A8cRvtvtOWVAZsCM1DU81GK4DL26R83y6ugZ1osV=ifA@mail.gmail.com
1 parent8592b56 commitf2f9e11

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

‎src/test/regress/pg_regress.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2198,6 +2198,17 @@ regression_main(int argc, char *argv[],
21982198
optind++;
21992199
}
22002200

2201+
/*
2202+
* We must have a database to run the tests in; either a default name, or
2203+
* one supplied by the --dbname switch.
2204+
*/
2205+
if (!(dblist&&dblist->str&&dblist->str[0]))
2206+
{
2207+
fprintf(stderr,_("%s: no database name was specified\n"),
2208+
progname);
2209+
exit(2);
2210+
}
2211+
22012212
if (config_auth_datadir)
22022213
{
22032214
#ifdefENABLE_SSPI

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp