ID: 41579
Updated by: tony2001@php.net
Reported By: vtsupermok at gmail dot com
-Status: Open
+Status: Feedback
Bug Type: PDO related
Operating System: Window
PHP Version: 5.2.3
New Comment:
What exactly do I need to do in order to reproduce it?
Previous Comments:
------------------------------------------------------------------------
[2007-06-04 04:25:10] vtsupermok at gmail dot com
Description:
------------
I create a pdo object and set PDO::ATTR_PERSISTENT => true, after
serveral hours I run my programme again. Suppose the connection will be
timeout and then the program throw a PDOException.
But the real situation is it said time out lost connection but it
wouldn't return a PDOException.
Reproduce code:
---------------
$db=array(
'name'=>'abc',
'host'=>'127.0.0.1',
'port'=>'3306',
'userID'=>'123',
'userPwd'=>'123',
'charset'=>'latin1',
'encoding'=>'big-5'
);
try{
$database="mysql:host={$db['host']};port={$db['port']};dbname={$db['name']}";
$pdo = new PDO($database, $db['userID'], $db['userPwd'],
array(PDO::ATTR_PERSISTENT => true));
} catch (PDOException $e) {
throw $e;
}
Expected result:
----------------
throw a exception.
Actual result:
--------------
the mysql error is timeout lost connection but it would't throw a
exception
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41579&edit=1