Project

General

Profile

Bug #21147 » 12071_v3.diff

Administrator Admin, 2009-10-01 08:18

View differences:

t3lib/class.t3lib_sqlparser.php (working copy)
// Looking for JOIN
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)) {
if ($stack[$pnt]['JOIN']['withTable'] = $this->nextPart($parseString,'^([[:alnum:]_]+)[[:space:]]+',1)) {
if (!preg_match('/^ON[[:space:]]+/i', $parseString)) {
$stack[$pnt]['JOIN']['as_keyword'] = $this->nextPart($parseString,'^(AS[[:space:]]+)');
$stack[$pnt]['JOIN']['as'] = $this->nextPart($parseString,'^([[:alnum:]_]+)[[:space:]]+');
}
if (!$this->nextPart($parseString, '^(ON[[:space:]]+)')) {
return $this->parseError('No join condition found in parseFromTables()!', $parseString);
}
$field1 = $this->nextPart($parseString,'^([[:alnum:]_.]+)[[:space:]]*=[[:space:]]*',1);
$field2 = $this->nextPart($parseString,'^([[:alnum:]_.]+)[[:space:]]+');
if ($field1 && $field2) {
......
}
if (is_array($v['JOIN'])) {
$outputParts[$k] .= ' '.$v['JOIN']['type'].' '.$v['JOIN']['withTable'].' ON ';
$outputParts[$k] .= ' ' . $v['JOIN']['type'] . ' ' . $v['JOIN']['withTable'];
// Add alias AS if there:
if ($v['JOIN']['as']) {
$outputParts[$k] .= ' ' . $v['JOIN']['as_keyword'] . ' ' . $v['JOIN']['as'];
}
$outputParts[$k] .= ' ON ';
$outputParts[$k] .= ($v['JOIN']['ON'][0]['table']) ? $v['JOIN']['ON'][0]['table'].'.' : '';
$outputParts[$k] .= $v['JOIN']['ON'][0]['field'];
$outputParts[$k] .= '=';
......
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_sqlparser.php']);
}
?>
?>
(2-2/2)