Changeset 3151

Show
Ignore:
Timestamp:
05/05/08 17:45:21 (2 months ago)
Author:
pmjones
Message:

Solar_Sql_Select: [CHG] In method countPages(), use subselect counting on DISTINCT queries, too.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Solar/Sql/Select.php

    r3134 r3151  
    11861186        } 
    11871187         
     1188        // look for a DISTINCT setting 
     1189        $is_distinct = $select->_parts['distinct']; 
     1190         
    11881191        // look in the WHERE and HAVING clauses for a `COUNT` condition 
    11891192        $has_count_cond = $this->_hasCountCond($select->_parts['where']) || 
    11901193                          $this->_hasCountCond($select->_parts['having']); 
    11911194         
    1192         // is there a count condition
    1193         if ($has_count_cond) { 
     1195        // is there a count condition or a distinct
     1196        if ($has_count_cond || $is_distinct) { 
    11941197             
    11951198            // count on a sub-select instead.