ID: 42371
Updated by: [EMAIL PROTECTED]
-Summary: PDO doesn`t throw Exception
Reported By: songqi at baidu dot com
-Status: Open
+Status: Assigned
Bug Type: PDO related
Operating System: Redhat linux
PHP Version: 5.2.3
-Assigned To:
+Assigned To: andrey
New Comment:
Andrey, any ideas about this? Seems more like an issue outside PHP..
Previous Comments:
------------------------------------------------------------------------
[2007-08-22 08:45:13] songqi at baidu dot com
Description:
------------
PDO doesn`t throw Exception when querying a sql with syntax error as
expected.
MySQL Client Version: 5.0.45
MySQL Server Version: 4.0.16
But if I connect to a MySQL5 server, it throws Exception correctly.
Same error happened in php-5.2.2
Reproduce code:
---------------
$dbt = new PDO("mysql:host=xxx;port=xxx;dbname=xxx",'xxx','xxx');
$dbt->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$a = $dbt->query("what happened?");
Expected result:
----------------
PDO should throw a Exception
Actual result:
--------------
nothing is throwed
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42371&edit=1