php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11201 Simultaneous DB Links
Submitted: 2001-05-30 15:01 UTC Modified: 2002-06-18 18:32 UTC
From: andrew at blackecho dot net Assigned:
Status: Closed Package: MySQL related
PHP Version: 4.0.4pl1 OS: RedHat 6.1
Private report: No CVE-ID: None
 [2001-05-30 15:01 UTC] andrew at blackecho dot net
This report is - I beleive - related to another bug (#8634) but that entry is hard to understand. I believe the problem #8634 is having is caused by mysql_connect() using the same resource identifier for two different connections with the exact same host, username & password argument combination. Thus, in #8634's problem, closing either of the two links causes them both to close becuase they share a common resource link.

I have a similar problem. I've co-written an abstract database layer object and it's recently come to my attention that the object behaves incorrectly when there are two different databases open on the same host. Through testing I've come to the conclusion that the problem is the mysql_connect() function. Since both databases are on the same system, the Connect() method of my object does not know that the second time it tries to connect that it is receiving a resource link already in user. Consequently, when it sets the active database, it disrupts the first object's connection to IT'S database.

While the functionality to preserve resource links and improve performance is certainly laudable, there needs to be some way to connect to the same host through different resource links. Either a parameter added mysql_connect() to force a new connection regardless of whether there is already one open or a new function (mysql_force_connect()?) that has the same functionality without the existant link check.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-30 15:03 UTC] andrew at blackecho dot net
(email above is invalid; use andrew@blackecho.ca instead)
 [2001-05-30 22:25 UTC] sniper@php.net
Duplicate of #8634

I can also reproduce the effect.

--Jani

 [2002-06-18 18:32 UTC] sniper@php.net
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at 
http://www.php.net/downloads.php


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 16:01:31 2024 UTC