[TYPO3-core] RFC: #12220: string literals quoted as identifiers in class.t3lib_loaddbgroup.php when using MySQL ANSI mode

Patrick Broens patrick at netcreators.com
Tue Oct 13 12:21:06 CEST 2009


Hi,

this is a SVN patch request.

Type: Bugfix

Bugtracker references:
http://bugs.typo3.org/view.php?id=12220

Branches: Trunk

Problem:
When using MySQL ANSI [1] mode, some mm_relations queries will not work
because string literals are quoted with double quotes instead of single
quotes.
This is producing errors in the DBAL as well, when working with, for
instance, an Oracle database.

Example:
When deleting a mm_relation a tt_news record (page or other news record)
the following SQL is generated by the DBAL for Oracle:
DELETE FROM "tt_news_related_mm" WHERE "uid_local" = 21 AND
("tablenames" = "tt_news" AND "uid_foreign" = 21)

The part "tablenames" = "tt_news" is not correct, because tt_news is
seen as an identifier by Oracle, because of the double quotes. For
string it must be quoted with single quotes, like
DELETE FROM "tt_news_related_mm" WHERE "uid_local" = 21 AND
("tablenames" = 'tt_news' AND "uid_foreign" = 21)

Solution:
Substitute the double quotes in class.t3lib_loaddbgroup.php with single
quotes.

Notes:
This is DBAL related as well

Patrick

[1]
http://dev.mysql.com/doc/refman/5.1/en/server-sql-mode.html#sqlmode_ansi_quotes
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 20091013_RFC_12220.diff
Url: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20091013/c0802508/attachment.txt 


More information about the TYPO3-team-core mailing list