diff options
author | Yasuo Ohgaki <yohgaki@php.net> | 2002-01-24 06:40:10 +0000 |
---|---|---|
committer | Yasuo Ohgaki <yohgaki@php.net> | 2002-01-24 06:40:10 +0000 |
commit | 448dbd72cda654c9fad3dc81ac26012f4fd3e794 (patch) | |
tree | 861b2605efae4782fcc4ef6d248e0cf23f5ec255 /ext/pgsql/pgsql.c | |
parent | ddee00da0e1a1ee8b3fef9b38844a6f902935874 (diff) | |
download | php-git-448dbd72cda654c9fad3dc81ac26012f4fd3e794.tar.gz |
Add a little more fault tolerance for pg_host, pg_tty and more.
Diffstat (limited to 'ext/pgsql/pgsql.c')
-rw-r--r-- | ext/pgsql/pgsql.c | 3 |
1 files changed, 3 insertions, 0 deletions
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); |