]> granicus.if.org Git - php/commitdiff
Add a little more fault tolerance for pg_host, pg_tty and more.
authorYasuo Ohgaki <yohgaki@php.net>
Thu, 24 Jan 2002 06:40:10 +0000 (06:40 +0000)
committerYasuo Ohgaki <yohgaki@php.net>
Thu, 24 Jan 2002 06:40:10 +0000 (06:40 +0000)
ext/pgsql/pgsql.c

index fe802a28de1a715b76e83e9d1cc22376dcda51ba..bbdec996ca42682cb24da3ffe1430a1d47cb065e 100644 (file)
@@ -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);