libpq: Fix wrong connection status on invalid "connect_timeout"
Lars Kanis <lars@greiz-reinsdorf.de>
From: Lars Kanis <lars@greiz-reinsdorf.de>
To: pgsql-hackers@lists.postgresql.org
Date: 2019-10-17T18:04:19Z
Lists: pgsql-hackers
Attachments
- 0001-Fix-wrong-connection-status-on-invalid-connect_timeo.patch (text/x-patch) patch 0001
Greetings, libpq since PostgreSQL-12 has stricter checks for integer values in connection parameters. They were introduced by commit https://github.com/postgres/postgres/commit/e7a2217978d9cbb2149bfcb4ef1e45716cfcbefb . However in case of "connect_timeout" such an invalid integer value leads to a connection status other than CONNECTION_OK or CONNECTION_BAD. The wrong parameter is therefore not properly reported to user space. This patch fixes this by explicit setting CONNECTION_BAD. The issue was raised on ruby-pg: https://github.com/ged/ruby-pg/issues/302 It originally came up at Heroku: https://github.com/heroku/stack-images/issues/147 -- Kind Regards, Lars Kanis
Commits
-
Fix error reporting of connect_timeout in libpq for value parsing
- ed5109a616cf 12.1 landed
- ba19a6b73c5b 13.0 landed
-
Fix parsing of integer values for connection parameters in libpq
- 2b0f959b5119 12.1 landed
- 4f4061b2dde1 13.0 landed
-
Parse more strictly integer parameters from connection strings in libpq
- e7a2217978d9 12.0 cited