|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-05-18 13:43 UTC] johannes@php.net
[2009-05-18 13:45 UTC] vrana@php.net
[2009-09-29 21:41 UTC] uw@php.net
[2009-11-04 19:01 UTC] uw@php.net
[2010-09-06 11:14 UTC] uw@php.net
[2011-01-13 11:51 UTC] johannes@php.net
-Status: Open
+Status: Bogus
[2011-01-13 11:51 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 06:00:01 2025 UTC |
Description: ------------ It seems that PDO_MySQL doesn't use prepared statements even with disabled PDO::MYSQL_ATTR_DIRECT_QUERY. If the prepared statements would by used then the binary data passed in the example wouldn't cause a parse error. MySQL version: 5.1.26 Reproduce code: --------------- <?php $pdo = new PDO("mysql:host=localhost", "ODBC", ""); $pdo->setAttribute(PDO::MYSQL_ATTR_DIRECT_QUERY, false); $pdo->exec("SET NAMES gbk"); $stmt = $pdo->prepare("SELECT ?"); $stmt->execute(array(chr(0xbf) . chr(0x27))); print_r($stmt->errorInfo()); ?> Expected result: ---------------- Array ( [0] => 00000 ) Actual result: -------------- Array ( [0] => 42000 [1] => 1064 [2] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''?\''' at line 1 )