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

Commit3b5548a

Browse files
committed
When using libpq URI syntax, error out on invalid parameter names.
Dan Farina
1 parentf1438cf commit3b5548a

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

‎src/interfaces/libpq/fe-connect.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4874,9 +4874,11 @@ conninfo_uri_parse_params(char *params,
48744874
return false;
48754875
}
48764876

4877-
fprintf(stderr,
4878-
libpq_gettext("WARNING: ignoring unrecognized URI query parameter: %s\n"),
4879-
keyword);
4877+
printfPQExpBuffer(errorMessage,
4878+
libpq_gettext(
4879+
"invalid URI query parameter \"%s\"\n"),
4880+
keyword);
4881+
return false;
48804882
}
48814883
if (malloced)
48824884
{

‎src/interfaces/libpq/test/expected.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ trying postgresql://host/db?u%73er=someotheruser&port=12345
5959
user='someotheruser' dbname='db' host='host' port='12345' (inet)
6060

6161
trying postgresql://host/db?u%7aer=someotheruser&port=12345
62-
WARNING: ignoring unrecognizedURI query parameter:uzer
63-
dbname='db' host='host' port='12345' (inet)
62+
uri-regress: invalidURI query parameter "uzer"
63+
6464

6565
trying postgresql://host:12345?user=uri-user
6666
user='uri-user' host='host' port='12345' (inet)
@@ -102,8 +102,8 @@ trying postgres://?host=/path/to/socket/dir
102102
host='/path/to/socket/dir' (local)
103103

104104
trying postgresql://host?uzer=
105-
WARNING: ignoring unrecognizedURI query parameter:uzer
106-
host='host' (inet)
105+
uri-regress: invalidURI query parameter "uzer"
106+
107107

108108
trying postgre://
109109
uri-regress: missing "=" after "postgre://" in connection info string

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp