#36222 [NEW]: errorInfo in PDOException is always NULL
| From: | traufeisen@php.net | Date: | Tue, 31 Jan 2006 09:40:11 +0000 |
| Subject: | #36222 [NEW]: errorInfo in PDOException is always NULL | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-92682@lists.php.net to get a copy of this message | ||
From: traufeisen@php.net
Operating system: CentOS 4
PHP version: 5.1.2
PHP Bug Type: PDO related
Bug description: errorInfo in PDOException is always NULL
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 bug report at http://bugs.php.net/?id=36222&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36222&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36222&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36222&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36222&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=36222&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36222&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36222&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36222&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36222&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36222&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=36222&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=36222&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36222&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36222&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36222&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36222&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36222&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36222&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36222&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36222&r=mysqlcfg