php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32191 Persistant Connection do not get revalidated on re-use and fail to reconnect
Submitted: 2005-03-04 12:57 UTC Modified: 2005-09-02 08:50 UTC
From: carstenklein at yahoo dot de Assigned:
Status: Not a bug Package: MySQL related
PHP Version: Any (I believe) OS: Fedora Core 2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: carstenklein at yahoo dot de
New email:
PHP Version: OS:

 

 [2005-03-04 12:57 UTC] carstenklein at yahoo dot de
Description:
------------
I have developed a database access layer that tries to ensure that proper result handling is provided for.

However, when using persistant connections I have the problem that whenever the database service fails (due to intermediate shutdown or other network related problems), the persistantly opened connection link to the database service does not revalidate its connection and as such will report a mysql_error() state of naught and as such it cannot be determined exactly as to where the error stems from.



Reproduce code:
---------------

I will not post any line of source code here, just an indepth explanation of how to reproduce:

start your mysql daemon.

open a persistant connection to the service.

do something with the connected and selected database.

shutdown the mysql daemon.

try to re-use the persistant connection using mysql_pconnect() and try to send a query to the service.

The query will fail, but there will not be any result code given by mysql_errno() that will provide any hint on the actual cause of the failure.


Expected result:
----------------
My code should produce a DbConnectionFailure instead of simply an DbUnexpectedFailure or DbUnknownFailure in case the persistant connection to the database fails because of the database service being no longer available.

Actual result:
--------------
DbUnknownFailure.

mysql_errno() fails to report error state.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-04 16:21 UTC] sniper@php.net
There is not 'Irrelevant' PHP version or operating system called 'Any'. Please fill those fields in this report properly.

 [2005-03-04 19:16 UTC] carstenklein at yahoo dot de
Well, as I did find two other bug-reports correlating to the same issue but with different database layers and for different operating systems and PHP versions I rendered it irrelevant to post both version and operating system. But here you go.
 [2005-09-02 08:50 UTC] sniper@php.net
We don't have PHP version 'Any (I believe)'. The PHP versions are numbers like '4.4.0' or '5.0.4'. They're not prefixed with anything either, they start with either 3, 4, 5 or 6.
Plus I can't reproduce. (and using persistent connections is deprecated anyway)


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 03:01:28 2024 UTC