php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9937 pg_close close any connection open with the same connection string
Submitted: 2001-03-22 14:15 UTC Modified: 2001-03-24 13:47 UTC
From: romolo at bicnet dot it Assigned:
Status: Closed Package: PostgreSQL related
PHP Version: 4.0 Latest CVS (22/03/2001) OS: Suse Linux 7.0 - apache 1.3.17
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: romolo at bicnet dot it
New email:
PHP Version: OS:

 

 [2001-03-22 14:15 UTC] romolo at bicnet dot 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. 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-24 13:47 UTC] romolo at bicnet dot it
Seem closed
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed May 07 21:01:30 2025 UTC