Skip to content

Commit

Permalink
collection: do not pass order by clause for subselect, if not needed;…
Browse files Browse the repository at this point in the history
… this fixes MS SQL support
  • Loading branch information
hrach committed Nov 11, 2017
1 parent 744ca9c commit c4e7239
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Mapper/Dbal/DbalCollection.php
Expand Up @@ -268,6 +268,9 @@ protected function getIteratorCount(): int
{
if ($this->resultCount === null) {
$builder = clone $this->queryBuilder;
if (!$builder->hasLimitOffsetClause()) {
$builder->orderBy(null);
}

/** @var StorageReflection $reflection */
$reflection = $this->mapper->getStorageReflection();
Expand Down

0 comments on commit c4e7239

Please sign in to comment.