EllisLab/CodeIgniter — pull request #2427 by maxiwheat (2013-04-25 16:07:14+00:00)
Title: Fixes issue with emulated prepared statements not returning false if failed

We had an issue with a SQL Statement that failed, silently even when
db_debug was set to true. We digged and find it was a bug in CodeIgniter
PDO driver (we actually use to for PostgreSQL 8.4). When using prepared
statements, the statement is not actually validated against the DB (it's
emulated) and PDO's prepare function returns the actual statement (as
$result_id in the code), even if it's bogus. Then this $result_id is
returned by the _execute function and make it to CI_DB_driver class
which uses the returned result to test it against FALSE, and the trigger
an error. This modification should fix that issue and be compatible with
other PDO drivers.