Browse Source

ZF-8441: fixed this bug, merged provided fix

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@24572 44c647ce-9c0f-0410-b52a-842ac1e357ba
bate 14 years ago
parent
commit
73751551b7
1 changed files with 2 additions and 1 deletions
  1. 2 1
      library/Zend/Paginator/Adapter/DbSelect.php

+ 2 - 1
library/Zend/Paginator/Adapter/DbSelect.php

@@ -218,7 +218,8 @@ class Zend_Paginator_Adapter_DbSelect implements Zend_Paginator_Adapter_Interfac
              * than one group, or if the query has a HAVING clause, then take
              * the original query and use it as a subquery os the COUNT query.
              */
-            if (($isDistinct && count($columnParts) > 1) || count($groupParts) > 1 || !empty($havingParts)) {
+            if (($isDistinct && ((count($columnParts) == 1 && $columnParts[0][1] == Zend_Db_Select::SQL_WILDCARD) 
+                 || count($columnParts) > 1)) || count($groupParts) > 1 || !empty($havingParts)) {
                 $rowCount->reset(Zend_Db_Select::ORDER);
                 $rowCount = $db
                                ->select()