History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: ZF-99
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Trivial Trivial
Assignee: Gavin
Reporter: Zend Framework
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

MySQL adapters quoteIdenfifier() quotes ` incorrectly (TRAC#95)

Created: 21/Jun/06 09:43 PM   Updated: 05/Jul/07 02:44 PM
Component/s: Zend_Db
Affects Version/s: 0.1.3
Fix Version/s: 0.1.5

Time Tracking:
Not Specified

Resolution Date: 04/Jul/06 01:12 PM


 Description  « Hide
http://framework.zend.com/developer/ticket/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/5.0/en/legal-names.html

05/28/06 03:00:45: Modified by anonymous

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



 All   Comments   Work Log   Change History   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Gavin - 04/Jul/06 12:20 PM
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.


Gavin - 04/Jul/06 12:25 PM
Aha .. more information appears in the MySQL 4.1 documentation than the MySQL 5.x documentation:
http://dev.mysql.com/doc/refman/4.1/en/legal-names.html

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?


Gavin - 04/Jul/06 01:12 PM
Although this issue is fixed, see the "FishEye" link for more related @todo tasks.