aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2019-10-21 11:39:28 +0900
committerMichael Paquier <michael@paquier.xyz>2019-10-21 11:39:28 +0900
commited5109a616cf98d3b3b2491d043099a6e0a966a2 (patch)
tree51e68bbe8011ef698e42fb652fba66f3631df78d /src/interfaces
parent2b0f959b5119cb2bb1d135ac04a8c5272bbcab03 (diff)
downloadpostgresql-ed5109a616cf98d3b3b2491d043099a6e0a966a2.tar.gz
postgresql-ed5109a616cf98d3b3b2491d043099a6e0a966a2.zip
Fix error reporting of connect_timeout in libpq for value parsing
The logic was correctly detecting a parsing failure, but the parsing error did not get reported back to the client properly. Reported-by: Ed Morley Author: Lars Kanis Reviewed-by: Michael Paquier Discussion: https://postgr.es/m/a9b4cbd7-4ecb-06b2-ebd7-1739bbff3217@greiz-reinsdorf.de Backpatch-through: 12
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/libpq/fe-connect.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index 957b9d26c13..9088c4cbce7 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -1992,7 +1992,11 @@ connectDBComplete(PGconn *conn)
{
if (!parse_int_param(conn->connect_timeout, &timeout, conn,
"connect_timeout"))
+ {
+ /* mark the connection as bad to report the parsing failure */
+ conn->status = CONNECTION_BAD;
return 0;
+ }
if (timeout > 0)
{