#38014 [Bgs]: Reference counting problem in (at least?) PostgreSQL
| From: | unex at linija dot org | Date: | Wed, 05 Jul 2006 12:06:26 +0000 |
| Subject: | #38014 [Bgs]: Reference counting problem in (at least?) PostgreSQL | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-99121@lists.php.net to get a copy of this message | ||
ID: 38014
User updated by: unex at linija dot org
Reported By: unex at linija dot org
Status: Bogus
Bug Type: Scripting Engine problem
Operating System: *BSD, but probably independent
PHP Version: 5.1.4
New Comment:
If you will use different databases - same problem exists. So it is a
bug.
Sorry for misunderstand.
Previous Comments:
------------------------------------------------------------------------
[2006-07-05 11:43:16] tony2001@php.net
http://php.net/pg_connect
If a second call is made to pg_connect() with the same
connection_string as an existing connection, the existing connection
will be returned unless you pass PGSQL_CONNECT_FORCE_NEW as
connect_type.
------------------------------------------------------------------------
[2006-07-05 11:37:58] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
.
------------------------------------------------------------------------
[2006-07-05 11:34:27] unex at linija dot org
Description:
------------
Seems there is a problem with reference counting. The further example
shows how pg_close() dereferences connection instead of just closing
one.
I'm not sure how PHP works, but this problem could exist deeper than in
PostgreSQL extension, but that's really yours competence.
Thanks.
Reproduce code:
---------------
<?
$Con1 = pg_connect("dbname=template1");
$Con2 = pg_connect("dbname=template1");
pg_close($Con1);
if(!ping($Con2)) echo "Connection 2 was closed too";
else pg_close($Con2);
?>
Expected result:
----------------
Only first connection should be closed.
Actual result:
--------------
Both connections was closed.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38014&edit=1