#42371 [Asn->Fbk]: PDO doesn`t throw Exception when querying MySQL Server 4.0.16 (Mysql 5 works!)
ID: 42371
Updated by: johannes@php.net
Reported By: songqi at baidu dot com
-Status: Assigned
+Status: Feedback
Bug Type: PDO related
Operating System: Redhat linux
PHP Version: 5.2.3
Assigned To: andrey
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.3-latest.tar.gz
For Windows (zip):
http://snaps.php.net/win32/php5.3-win32-latest.zip
For Windows (installer):
http://snaps.php.net/win32/php5.3-win32-installer-latest.msi
Previous Comments:
------------------------------------------------------------------------
[2007-10-08 10:55:24] mpub at meiners-online dot de
If the different client- and server-versions are simply not meant to be
compatible and it isn't a bug, it seems useful to me to raise an
E_WARNING or E_NOTICE. This could help a lot of people by warning them.
------------------------------------------------------------------------
[2007-10-05 14:54:24] mpub at meiners-online dot de
I also use PHP 5 and MySQL 4 and had the same problem. When I use
PHPMyAdmin it says "Your PHP MySQL library version 5.0.18 differs from
your MySQL server version 4.0.27. This may cause unpredictable
behavior." This confirms the existence of the problem. It seems to be a
well-known problem. Otherwise it could be useful to contact the
developers of PHPMyAdmin to find out more about their experiences.
------------------------------------------------------------------------
[2007-08-24 10:32:22] jani@php.net
Andrey, any ideas about this? Seems more like an issue outside PHP..
------------------------------------------------------------------------
[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
Thread (5 messages)