Skip to content

Commit ed5109a

Browse files
committed
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
1 parent 2b0f959 commit ed5109a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/interfaces/libpq/fe-connect.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1992,7 +1992,11 @@ connectDBComplete(PGconn *conn)
19921992
{
19931993
if (!parse_int_param(conn->connect_timeout, &timeout, conn,
19941994
"connect_timeout"))
1995+
{
1996+
/* mark the connection as bad to report the parsing failure */
1997+
conn->status = CONNECTION_BAD;
19951998
return 0;
1999+
}
19962000

19972001
if (timeout > 0)
19982002
{

0 commit comments

Comments
 (0)