Shardj / zf1-future

PHP 8.1 compatible version of ZF1
BSD 3-Clause "New" or "Revised" License
442 stars 196 forks source link

Order of distinct and top is wrong #421

Closed muuvmuuv closed 4 days ago

muuvmuuv commented 5 months ago

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

muuvmuuv commented 5 months ago

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

develart-projects commented 2 weeks ago

Anyone to create PR and test locally?

muuvmuuv commented 2 weeks ago

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

develart-projects commented 2 weeks ago

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

muuvmuuv commented 4 days ago

Just created a pr. Wasn't able to run the sqlsrv tests ("test") but all other tests run well.