Skip to content

Commit

Permalink
doctrine#4437 MSSQL adds a redundant ORDER BY clause when with subque…
Browse files Browse the repository at this point in the history
…ry with ORDER BY

Test case
  • Loading branch information
trusek committed Nov 17, 2020
1 parent 79cba0b commit 192aa01
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -479,4 +479,12 @@ public function testModifyLimitQueryWithNewlineBeforeOrderBy(): void
$sql = $this->platform->modifyLimitQuery($querySql, 10);
self::assertEquals($expectedSql, $sql);
}

public function testModifyLimitQueryWithManyOrderBy(): void
{
$querySql = 'SELECT col1 FROM test ORDER BY ( SELECT col2 from test ORDER BY col2 )';
$expectedSql = 'SELECT col1 FROM test ORDER BY ( SELECT col2 from test ORDER BY col2 ) OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY';
$sql = $this->platform->modifyLimitQuery($querySql, 10);
self::assertEquals($expectedSql, $sql);
}
}

0 comments on commit 192aa01

Please sign in to comment.