Commit e7732ee9 authored by zYne's avatar zYne

DQL limit-subquery-algorithm ORDER BY handling fixed

parent cfa0351d
......@@ -751,14 +751,14 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
$subquery .= ' FROM';
foreach ($this->parts['from'] as $part) {
// preserve LEFT JOINs only if needed
if (substr($part, 0, 9) === 'LEFT JOIN') {
$e = explode(' ', $part);
if ( ! in_array($e[3], $this->subqueryAliases) &&
! in_array($e[2], $this->subqueryAliases)) {
continue;
if (empty($this->parts['orderby']) && empty($this->parts['where'])) {
continue;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment