Project

General

Profile

Feature #21902 » pre_13134_dbal-cleanup.diff

Administrator Admin, 2010-01-05 18:13

View differences:

class.ux_t3lib_sqlparser.php (working copy)
// Look for sublevel:
if (is_array($v['sub'])) {
$output .= ' (' . trim($this->compileWhereClause($v['sub'], $functionMapping)) . ')';
} elseif (isset($v['func'])) {
$output .= ' ' . trim($v['modifier']) . ' ' . $v['func']['type'] . ' (' . $this->compileSELECT($v['func']['subquery']) . ')';
} elseif (isset($v['func']) && $v['func']['type'] === 'EXISTS') {
$output .= ' ' . trim($v['modifier']) . ' EXISTS (' . $this->compileSELECT($v['func']['subquery']) . ')';
} else {
// Set field/table with modifying prefix if any:
class.ux_t3lib_db.php (working copy)
if (is_array($where_clause[$k]['sub'])) {
$where_clause[$k]['sub'] = $this->_quoteWhereClause($where_clause[$k]['sub']);
} elseif (isset($v['func'])) {
$where_clause[$k]['func']['subquery'] = $this->quoteSELECTsubquery($v['func']['subquery']);
switch ($where_clause[$k]['func']['type']) {
case 'EXISTS':
$where_clause[$k]['func']['subquery'] = $this->quoteSELECTsubquery($v['func']['subquery']);
break;
}
} else {
if ($where_clause[$k]['table'] != '') {
$where_clause[$k]['table'] = $this->quoteName($where_clause[$k]['table']);
......
if (is_array($sqlPartArray[$k]['sub'])) {
$this->map_sqlParts($sqlPartArray[$k]['sub'], $defaultTable); // Call recursively!
} elseif (isset($sqlPartArray[$k]['func'])) {
$subqueryDefaultTable = $sqlPartArray[$k]['func']['subquery']['FROM'][0]['table'];
$this->map_sqlParts($sqlPartArray[$k]['func']['subquery']['SELECT'], $subqueryDefaultTable);
$this->map_sqlParts($sqlPartArray[$k]['func']['subquery']['FROM'], $subqueryDefaultTable);
$this->map_sqlParts($sqlPartArray[$k]['func']['subquery']['WHERE'], $subqueryDefaultTable);
switch ($sqlPartArray[$k]['func']['type']) {
case 'EXISTS':
$subqueryDefaultTable = $sqlPartArray[$k]['func']['subquery']['FROM'][0]['table'];
$this->map_sqlParts($sqlPartArray[$k]['func']['subquery']['SELECT'], $subqueryDefaultTable);
$this->map_sqlParts($sqlPartArray[$k]['func']['subquery']['FROM'], $subqueryDefaultTable);
$this->map_sqlParts($sqlPartArray[$k]['func']['subquery']['WHERE'], $subqueryDefaultTable);
break;
}
} else {
// For the field, look for table mapping (generic):
$t = $sqlPartArray[$k]['table'] ? $sqlPartArray[$k]['table'] : $defaultTable;
(2-2/4)