ZF-99: MySQL adapters quoteIdenfifier() quotes ` incorrectly (TRAC#95)



Zend_Db_Adapter_Mysqli::quoteIdentifier() and Zend_Db_Adapter_Pdo_Mysql::quoteIdentifier() quote in identifiers as \ instead of

See http://dev.mysql.com/doc/refman/…

{quote} 05/28/06 03:00:45: Modified by anonymous

should be: ... quote backticks in identifiers as backslash+backtick instaed of double backticks {quote}


According to the MySQL man page above:

Identifier quote characters can be included within an identifier if you quote the identifier. If the character to be included within the identifier is the same as that used to quote the identifier itself, then you need to double the character. The following statement creates a table named a`b that contains a column named c"d:

mysql> CREATE TABLE a``b (c"d INT);

Thus, it seems we should do the opposite of the suggestion recommended in this issue ticket's description.

Aha .. more information appears in the MySQL 4.1 documentation than the MySQL 5.x documentation: http://dev.mysql.com/doc/refman/…

Thus, the doubling of the quote character quoting mechanism was introduced with MySQL 4.1. I'll insert an @todo to support older versions of MySQL 4.1, and patch now to support 4.1+.

BTW, is anyone actually still using versions of MySQL older than 4.1.x?

Although this issue is fixed, see the "FishEye" link for more related @todo tasks.