Commit 8f7df67c authored by Benjamin Eberlei's avatar Benjamin Eberlei

DBAL-146 - Bugfix with SQL Server SELECT DISTINCT and modifyLimitQuery().

parent a481a227
...@@ -647,7 +647,7 @@ class MsSqlPlatform extends AbstractPlatform ...@@ -647,7 +647,7 @@ class MsSqlPlatform extends AbstractPlatform
} }
if ($offset == 0) { if ($offset == 0) {
$query = preg_replace('/^SELECT\s/i', 'SELECT TOP ' . $count . ' ', $query); $query = preg_replace('/^(SELECT\s(DISTINCT)?)/i', '\1 TOP ' . $count . ' ', $query);
} else { } else {
$orderby = stristr($query, 'ORDER BY'); $orderby = stristr($query, 'ORDER BY');
......
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