From:             carstenklein at yahoo dot de
Operating system: Any
PHP version:      Irrelevant
PHP Bug Type:     MySQL related
Bug description:  Persistant Connection do not get revalidated on re-use and 
fail to reconnect

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.


-- 
Edit bug report at http://bugs.php.net/?id=32191&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=32191&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=32191&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=32191&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=32191&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=32191&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=32191&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=32191&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=32191&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=32191&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=32191&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=32191&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=32191&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=32191&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=32191&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=32191&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=32191&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=32191&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=32191&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=32191&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=32191&r=mysqlcfg

Reply via email to