Merge branch 'DDC-1985' into 2.4
This commit is contained in:
commit
a949e87ca8
@ -160,11 +160,8 @@ class LimitSubqueryOutputWalker extends SqlWalker
|
||||
$sql = sprintf('SELECT DISTINCT %s FROM (%s) dctrn_result',
|
||||
implode(', ', $sqlIdentifier), $innerSql);
|
||||
|
||||
if ($this->platform instanceof PostgreSqlPlatform ||
|
||||
$this->platform instanceof OraclePlatform) {
|
||||
//http://www.doctrine-project.org/jira/browse/DDC-1958
|
||||
$this->preserveSqlOrdering($AST, $sqlIdentifier, $innerSql, $sql);
|
||||
}
|
||||
// http://www.doctrine-project.org/jira/browse/DDC-1958
|
||||
$sql = $this->preserveSqlOrdering($AST, $sqlIdentifier, $innerSql, $sql);
|
||||
|
||||
// Apply the limit and offset.
|
||||
$sql = $this->platform->modifyLimitQuery(
|
||||
@ -192,7 +189,7 @@ class LimitSubqueryOutputWalker extends SqlWalker
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function preserveSqlOrdering(SelectStatement $AST, array $sqlIdentifier, $innerSql, &$sql)
|
||||
public function preserveSqlOrdering(SelectStatement $AST, array $sqlIdentifier, $innerSql, $sql)
|
||||
{
|
||||
// For every order by, find out the SQL alias by inspecting the ResultSetMapping.
|
||||
$sqlOrderColumns = array();
|
||||
@ -215,11 +212,6 @@ class LimitSubqueryOutputWalker extends SqlWalker
|
||||
$sqlOrderColumns = array_diff($sqlOrderColumns, $sqlIdentifier);
|
||||
}
|
||||
|
||||
// We don't need orderBy in inner query.
|
||||
// However at least on 5.4.6 I'm getting a segmentation fault and thus we don't clear it for now.
|
||||
/*$AST->orderByClause = null;
|
||||
$innerSql = parent::walkSelectStatement($AST);*/
|
||||
|
||||
if (count($orderBy)) {
|
||||
$sql = sprintf(
|
||||
'SELECT DISTINCT %s FROM (%s) dctrn_result ORDER BY %s',
|
||||
@ -228,5 +220,7 @@ class LimitSubqueryOutputWalker extends SqlWalker
|
||||
implode(', ', $orderBy)
|
||||
);
|
||||
}
|
||||
|
||||
return $sql;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user