Project

General

Profile

Actions

Bug #19734

closed

t3lib_db explainOutput does not work with tablealias

Added by Nabil Saleh over 15 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2008-12-22
Due date:
% Done:

0%

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

Description

Using table aliases in an SQL having t3lib_db::explainOutput ==1 causes mysql errors as t3lib_db::explain function calles explain the executed query and uses returned tablenames to "SHOW INDEX FROM" it. The problem with this is that col 'table' returned by explain can be an alias from a table and then "SHOW INDEX FROM " returns in "table does not exist" error.

code:
$GLOBALS['TYPO3_DB']->exec_SELECTgetRows('a.uid,b.uid','be_users a,be_users b','1');
produces:
caller t3lib_DB::exec_SELECTquery
ERROR Table 'DBNAME.b' doesn't exist
lastBuiltQuery SELECT a.uid,b.uid
FROM be_users a,be_users b
WHERE
1

(issue imported from #M10003)


Files

t3lib_db.diff (1.16 KB) t3lib_db.diff Administrator Admin, 2009-03-02 09:44
10003.patch (989 Bytes) 10003.patch Administrator Admin, 2009-10-29 15:23
Actions #1

Updated by Nabil Saleh about 15 years ago

with this patch each table is checked on existance in DB first

Actions #2

Updated by Dan Osipov over 14 years ago

Updated patch sent to the core list

Actions #3

Updated by Xavier Perseguers about 14 years ago

Committed:

- trunk (rev. 7073)
- 4-3 (rev. 7074)

Actions #4

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF