|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-12-24 19:04 UTC] wez@php.net
[2005-12-24 21:54 UTC] spaze-bugs at exploited dot cz
[2005-12-25 13:19 UTC] spaze-bugs at exploited dot cz
[2005-12-25 17:37 UTC] sniper@php.net
[2005-12-25 20:27 UTC] wez@php.net
[2005-12-25 21:31 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 29 02:00:01 2025 UTC |
Description: ------------ I'm running MySQL in ANSI SQL mode [1], which includes the ANSI_QUOTES mode. That means /Treat ?"? as an identifier quote character (like the ?`? quote character) and not as a string quote character./ When I use ie. prepared statements I get these queries in the general query log INSERT INTO "t_images" ("hash", "width", "height", "imageformat_id") VALUES ("ff2204530628d3c589843ef0b37d344a", "500", "500", NULL) Which is bad, the strings (the hash) in the VALUES (...) section should be quoted by the ' character. Don't know what would be the best solution, but I think some documented MySQL specific PDO attribute would be Ok. Thanks for reviewing this issue. [1] http://dev.mysql.com/doc/refman/4.1/en/server-sql-mode.html Reproduce code: --------------- $dbh = new PDO('mysql:host=mysql41;dbname=test', 'root', ''); $dbh->exec("SET SESSION sql_mode='ANSI'"); echo $dbh->quote('foo'); Expected result: ---------------- 'foo' Actual result: -------------- "foo"