diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-12-20 11:44:23 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-12-20 11:45:16 +0100 |
commit | f974f252ddf47da1294a813ffb60e82f3638186c (patch) | |
tree | 458f660cd603b045438e239f10021e0b5e879232 | |
parent | 10eb0b3110638c65f133c5ccc1cf2303db79e2bb (diff) | |
parent | 7e39e6934d7eb3f480a467de7d9fbca608fc1e94 (diff) | |
download | php-git-f974f252ddf47da1294a813ffb60e82f3638186c.tar.gz |
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Fix #78980: pgsqlGetNotify() overlooks dead connection
-rw-r--r-- | NEWS | 10 | ||||
-rw-r--r-- | ext/pdo_pgsql/pgsql_driver.c | 12 |
2 files changed, 20 insertions, 2 deletions
@@ -13,6 +13,10 @@ PHP NEWS . Fixed bug #78999 (Cycle leak when using function result as temporary). (Dmitry) +- Fileinfo: + . Fixed bug #74170 (locale information change after mime_content_type). + (Sergei Turchanov) + - OPcache: . Fixed bug #78961 (erroneous optimization of re-assigned $GLOBALS). (Dmitry) . Fixed bug #78950 (Preloading trait method with static variables). (Nikita) @@ -21,9 +25,15 @@ PHP NEWS . Fixed bug #78986 (Opcache segfaults when inheriting ctor from immutable into mutable class). (Nikita) +- Pcntl: + . Fixed bug #78402 (Converting null to string in error message is bad DX). + (SATŌ Kentarō) + - PDO_PgSQL: . Fixed bug #78983 (pdo_pgsql config.w32 cannot find libpq-fe.h). (SATŌ Kentarō) + . Fixed bug #78980 (pgsqlGetNotify() overlooks dead connection). (SATŌ + Kentarō) - Spl: . Fixed bug #78976 (SplFileObject::fputcsv returns -1 on failure). (cmb) diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index 9c5df24ab5..a32d52c6a4 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -1068,13 +1068,21 @@ static PHP_METHOD(PDO, pgsqlGetNotify) H = (pdo_pgsql_db_handle *)dbh->driver_data; - PQconsumeInput(H->server); + if (!PQconsumeInput(H->server)) { + pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL); + PDO_HANDLE_DBH_ERR(); + RETURN_FALSE; + } pgsql_notify = PQnotifies(H->server); if (ms_timeout && !pgsql_notify) { php_pollfd_for_ms(PQsocket(H->server), PHP_POLLREADABLE, (int)ms_timeout); - PQconsumeInput(H->server); + if (!PQconsumeInput(H->server)) { + pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL); + PDO_HANDLE_DBH_ERR(); + RETURN_FALSE; + } pgsql_notify = PQnotifies(H->server); } |