PHP 4.0 Bug #9937 Updated: pg_close close any connection open with the same connection string
| From: | romolo at bicnet dot it | Date: | Sat, 24 Mar 2001 18:47:58 +0000 |
| Subject: | PHP 4.0 Bug #9937 Updated: pg_close close any connection open with the same connection string | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-49893@lists.php.net to get a copy of this message | ||
ID: 9937
User Update by: romolo@bicnet.it
Old-Status: Open
Status: Closed
Bug Type: PostgreSQL related
Description: pg_close close any connection open with the same connection string
Seem closed
Previous Comments:
---------------------------------------------------------------------------
[2001-03-22 14:15:32] romolo@bicnet.it
<?php
$conn=pg_connect("connection string");
$conn1=pg_connect("connection string");
echo $conn."<br>"; // output 1
echo $conn1."<br>"; // output 1
pg_close($conn);
pg_close($conn1); // results in invalid resource ID error
?>
looking at the code I can see that if you try to open two db connections, with the same connection
string, only one
really get opened, to the second one instead is assigned the same resource ID of the first and
zend_list_addref function is called for the resource. If you close the first connection, it really
get closed taking no care of the
number of references to the resource.
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=9937