From 448dbd72cda654c9fad3dc81ac26012f4fd3e794 Mon Sep 17 00:00:00 2001 From: Yasuo Ohgaki Date: Thu, 24 Jan 2002 06:40:10 +0000 Subject: [PATCH] Add a little more fault tolerance for pg_host, pg_tty and more. --- ext/pgsql/pgsql.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index fe802a28de..bbdec996ca 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -721,6 +721,9 @@ void php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type) ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink); + if (PQstatus(pgsql) != CONNECTION_OK) { + PQreset(pgsql); + } switch(entry_type) { case PHP_PG_DBNAME: Z_STRVAL_P(return_value) = PQdb(pgsql); -- 2.50.1