Re: Passing error codes through to PDOException
I also just attached the following to the bug - it's a test that checks this fix in
the sqlite driver - I can write tests for all the others if need be, but I figured
there are others who might already be more familiar with the individual PDO drivers
that would write them more quickly than I.
--TEST--
Bug #50728 (All PDOExceptions hardcode 'code' property to 0) (crash on PDO::FETCH_CLASS + __set())
--SKIPIF--
<?php # vim:ft=php
if (!extension_loaded('pdo_sqlite')) print 'skip not loaded';
?>
--FILE--
<?php
try {
$a = new PDO("sqlite:/this/path/should/not/exist.db");
} catch (PDOException $e) {
var_dump($e->getCode());
}
?>
--EXPECTF--
int(14)
Thread (4 messages)