Skip to content

Commit b0737fa

Browse files
committed
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #78982: pdo_pgsql returns dead persistent connection
2 parents f974f25 + 37d11d1 commit b0737fa

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ PHP NEWS
3434
Kentarō)
3535
. Fixed bug #78980 (pgsqlGetNotify() overlooks dead connection). (SATŌ
3636
Kentarō)
37+
. Fixed bug #78982 (pdo_pgsql returns dead persistent connection). (SATŌ
38+
Kentarō)
3739

3840
- Spl:
3941
. Fixed bug #78976 (SplFileObject::fputcsv returns -1 on failure). (cmb)

ext/pdo_pgsql/pgsql_driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ static int pdo_pgsql_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_
473473
static int pdo_pgsql_check_liveness(pdo_dbh_t *dbh)
474474
{
475475
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
476-
if (PQstatus(H->server) == CONNECTION_BAD) {
476+
if (!PQconsumeInput(H->server) || PQstatus(H->server) == CONNECTION_BAD) {
477477
PQreset(H->server);
478478
}
479479
return (PQstatus(H->server) == CONNECTION_OK) ? SUCCESS : FAILURE;

0 commit comments

Comments
 (0)