]> granicus.if.org Git - php/commitdiff
@- fixes PostgeSQL pg_connect() bug. We would sometimes close the default
authorThies C. Arntzen <thies@php.net>
Tue, 13 Feb 2001 16:54:48 +0000 (16:54 +0000)
committerThies C. Arntzen <thies@php.net>
Tue, 13 Feb 2001 16:54:48 +0000 (16:54 +0000)
@  link by acciedent. (Patch by: aja@nlgroup.ca)

ext/pgsql/pgsql.c

index 5ee40eebafbbe4f0c25f19b58c356b6aa8479a65..ce4b7fc3b8c73d6f1a58ac10e86b780e64aae756 100644 (file)
@@ -114,9 +114,10 @@ static void php_pgsql_set_default_link(int id)
 {   
        PGLS_FETCH();
 
-    if (PGG(default_link)!=-1) {
+    if ((PGG(default_link) != -1) && (PGG(default_link) != id)) {
         zend_list_delete(PGG(default_link));
     }
+
     if (PGG(default_link) != id) {
         PGG(default_link) = id;
         zend_list_addref(id);