Project

General

Profile

Actions

Bug #21261

closed

string literals quoted as identifiers in class.t3lib_loaddbgroup.php

Added by Patrick Broens over 14 years ago. Updated about 14 years ago.

Status:
Closed
Priority:
Should have
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2009-10-13
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Problem:

When using MySQL ANSI mode, some mm_relations operations 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.

(issue imported from #M12220)


Files

20091013_RFC_12220.diff (2.46 KB) 20091013_RFC_12220.diff Administrator Admin, 2009-10-13 12:13
12220_v2.diff (2.65 KB) 12220_v2.diff Administrator Admin, 2010-02-13 00:03

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #20432: DB check breaks with MySQL in ANSI mode due to double quotesClosedKarsten Dambekalns2009-05-15

Actions
Actions #1

Updated by Xavier Perseguers about 14 years ago

Uploaded v2 with use of official quoting method $GLOBALS['TYPO3_DB']->fullQuoteStr() instead of hard-coding single quotes.

Actions #2

Updated by Xavier Perseguers about 14 years ago

Committed to TYPO3 Core:

- trunk (rev. 6927)
- 4-3 (rev. 6928)
- 4-2 (rev. 6929)

Actions

Also available in: Atom PDF