Project

General

Profile

Actions

Bug #15501

closed

LEFT OUTER JOIN

Added by Christian Welzel almost 19 years ago. Updated over 18 years ago.

Status:
Closed
Priority:
Should have
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2006-01-25
Due date:
% Done:

0%

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

Description

tt_news uses

...
$selectConf['leftjoin'] = 'tt_news_cat_mm ON tt_news.uid = tt_news_cat_mm.uid_local';
$selectConf['groupBy'] = 'tt_news_cat_mm.uid_foreign';
$selectConf['selectFields'] = 'DISTINCT tt_news.uid,tt_news.*';
...
$res = $this->cObj->exec_getQuery('tt_news', $selectConf);

which results in an error

DBAL fatal error: No tables found: "tt_news LEFT OUTER JOIN tt_news_cat_mm ON tt_news.uid = tt_news_cat_mm.uid_local"

(issue imported from #M2380)

Actions #1

Updated by Karsten Dambekalns over 18 years ago

In class.t3lib_sqlparser.php around line 818 apply this pseudo-diff, and it works:
} else return $this->parseError('No table name found as expected in parseFromTables()!',$parseString);

// Looking for JOIN
- if ($join = $this->nextPart($parseString,'^(LEFT[[:space:]]+JOIN|JOIN)[[:space:]]+')) {
+ if ($join = $this->nextPart($parseString,'^(LEFT[[:space:]]+JOIN|LEFT[[:space:]]+OUTER[[:space:]]+JOIN|JOIN)[[:space:]]+')) {
$stack[$pnt]['JOIN']['type'] = $join;
if ($stack[$pnt]['JOIN']['withTable'] = $this->nextPart($parseString,'^([[:alnum:]_]+)[[:space:]]+ON[[:space:]]+',1)) {
$field1 = $this->nextPart($parseString,'^([[:alnum:]_.]+)[[:space:]]*=[[:space:]]*',1);

This will be sent to the core list for review now...

Actions #2

Updated by Michael Stucki over 18 years ago

Fixed in CVS.

Actions

Also available in: Atom PDF