Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #78982: pdo_pgsql returns dead persistent connection
This commit is contained in:
Nikita Popov 2019-12-20 12:06:24 +01:00
commit ed372541da

View File

@ -471,7 +471,7 @@ static int pdo_pgsql_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_
static int pdo_pgsql_check_liveness(pdo_dbh_t *dbh)
{
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
if (PQstatus(H->server) == CONNECTION_BAD) {
if (!PQconsumeInput(H->server) || PQstatus(H->server) == CONNECTION_BAD) {
PQreset(H->server);
}
return (PQstatus(H->server) == CONNECTION_OK) ? SUCCESS : FAILURE;