mirror of
https://github.com/postgres/postgres.git
synced 2025-11-13 16:22:44 +03:00
libpq: Improve error message when parsing URI parameters and keywords
The error message showing up when parameters or keywords include too
many whitespaces was "trailing data found", which was confusing because
there was no hint about what was actually wrong.
Issue introduced in 430ce189fc, hence there is no need for a
backpatch.
Author: Yushi Ogiwara
Reviewed-by: Fujii Masao, Tom Lane, Bruce Momjian
Discussion: https://postgr.es/m/645bd22a53c4da8a1bc7e1e52d9d3b52@oss.nttdata.com
This commit is contained in:
@@ -6825,7 +6825,9 @@ end:
|
||||
/* Not at the end of the string yet? Fail. */
|
||||
if (*q != '\0')
|
||||
{
|
||||
libpq_append_error(errorMessage, "trailing data found: \"%s\"", str);
|
||||
libpq_append_error(errorMessage,
|
||||
"unexpected spaces found in \"%s\", use percent-encoded spaces (%%20) instead",
|
||||
str);
|
||||
free(buf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user