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 ...@@ -751,14 +751,14 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
$subquery .= ' FROM'; $subquery .= ' FROM';
foreach ($this->parts['from'] as $part) { foreach ($this->parts['from'] as $part) {
// preserve LEFT JOINs only if needed // preserve LEFT JOINs only if needed
if (substr($part, 0, 9) === 'LEFT JOIN') { if (substr($part, 0, 9) === 'LEFT JOIN') {
$e = explode(' ', $part); $e = explode(' ', $part);
if ( ! in_array($e[3], $this->subqueryAliases) && if (empty($this->parts['orderby']) && empty($this->parts['where'])) {
! in_array($e[2], $this->subqueryAliases)) { continue;
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