#36222 [Asn->Csd]: errorInfo in PDOException is always NULL
| From: | iliaa@php.net | Date: | Tue, 31 Jan 2006 17:21:33 +0000 |
| Subject: | #36222 [Asn->Csd]: errorInfo in PDOException is always NULL | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-92719@lists.php.net to get a copy of this message | ||
ID: 36222
Updated by: iliaa@php.net
Reported By: traufeisen@php.net
-Status: Assigned
+Status: Closed
Bug Type: PDO related
Operating System: CentOS 4
PHP Version: 5.1.2
Assigned To: wez
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2006-01-31 10:40:10] traufeisen@php.net
Description:
------------
If PDO is using ERRMODE_EXCEPTION, the errorInfo property of
PDOException is not filled with the driver specific errorinformation.
A patch is available at http://www.phpschlampe.de/pdo_dbh.patch
Reproduce code:
---------------
<?php
$sql = new PDO
("mysql:host=localhost;dbname=test","foo","bar");
$sql -> setAttribute
(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
try{
$sql -> query ("INSERT INTO test.nonexistent (id)
VALUES (1)");
}catch(PDOException $e){
echo $e->getMessage();
print_r($e->errorInfo);
}
?>
Expected result:
----------------
Output of the errormessage and a filled errorInfo-Array
Actual result:
--------------
errormessage is ok, but errorInfo is NULL
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36222&edit=1