#42371 [Opn->Asn]: PDO doesn`t throw Exception when querying MySQL Server 4.0.16 (Mysql 5 works!)
| From: | jani@php.net | Date: | Fri, 24 Aug 2007 10:32:23 +0000 |
| Subject: | #42371 [Opn->Asn]: PDO doesn`t throw Exception when querying MySQL Server 4.0.16 (Mysql 5 works!) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-116607@lists.php.net to get a copy of this message | ||
ID: 42371
Updated by: jani@php.net
-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