From 7619e6947daf0e53d80e14cbe656213d7364f351 Mon Sep 17 00:00:00 2001 From: pasinter Date: Thu, 28 Jul 2011 10:54:03 +1200 Subject: [PATCH] fix bug in previous commit --- Platforms/DblibPlatform.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platforms/DblibPlatform.php b/Platforms/DblibPlatform.php index a13c721..5a59ee0 100644 --- a/Platforms/DblibPlatform.php +++ b/Platforms/DblibPlatform.php @@ -60,7 +60,7 @@ protected function doModifyLimitQuery($query, $limit, $offset = null) if ($offset == 0) { // SELECT TOP DISTINCT does not work with mssql - if(preg_match('#^SELECT\s+DISTINCT#i', $query) !== false) { + if(preg_match('#^SELECT\s+DISTINCT#i', $query) > 0) { $query = preg_replace('/^SELECT\s+DISTINCT\s/i', 'SELECT DISTINCT TOP ' . $count . ' ', $query); } else { $query = preg_replace('/^SELECT\s/i', 'SELECT TOP ' . $count . ' ', $query);