|
|
@@ -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()
|