Shardj/zf1-future

Order of distinct and top is wrong

muuvmuuv opened this issue · 5 comments

When using both, distinct will come after "top 20" which results in an SQL error.

Fix:

$sql = preg_replace('/^SELECT(\s+DISTINCT)?\s/i', 'SELECT$1 TOP ' . $count . ' ', $sql);

In shardj/zf1-future/library/Zend/Db/Adapter/Sqlsrv.php:618

Anyone to create PR and test locally?

Does it have or need tests? We have it in production at one customer and no issues since i vreated the ticket so far

If it's already proven, then just create an PR pls.