Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #78982: pdo_pgsql returns dead persistent connection
This commit is contained in:
Nikita Popov 2019-12-20 12:05:39 +01:00
commit b0737fa35e
2 changed files with 3 additions and 1 deletions

2
NEWS
View File

@ -34,6 +34,8 @@ PHP NEWS
Kentarō)
. Fixed bug #78980 (pgsqlGetNotify() overlooks dead connection). (SATŌ
Kentarō)
. Fixed bug #78982 (pdo_pgsql returns dead persistent connection). (SATŌ
Kentarō)
- Spl:
. Fixed bug #78976 (SplFileObject::fputcsv returns -1 on failure). (cmb)

View File

@ -473,7 +473,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;