Changeset 3154
- Timestamp:
- 05/06/08 13:13:07 (2 months ago)
- Files:
-
- trunk/Solar/Sql/Select.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Solar/Sql/Select.php
r3153 r3154 1186 1186 } 1187 1187 1188 // look for a DISTINCTsetting1189 $ is_distinct = $select->_parts['distinct'];1188 // look for a GROUP setting 1189 $has_grouping = (bool) $select->_parts['group']; 1190 1190 1191 1191 // look in the WHERE and HAVING clauses for a `COUNT` condition … … 1193 1193 $this->_hasCountCond($select->_parts['having']); 1194 1194 1195 // is there a count condition or a distinct?1196 if ($has_ count_cond || $is_distinct) {1195 // is there a grouping or a count condition? 1196 if ($has_grouping || $has_count_cond) { 1197 1197 1198 1198 // count on a sub-select instead. … … 1201 1201 } else { 1202 1202 1203 // "normal" case (no count condition in WHERE or HAVING).1204 // add the one column we're counting on...1203 // "normal" case (no grouping, and no count condition in WHERE or 1204 // HAVING). add the one column we're counting on... 1205 1205 $select->_addSource( 1206 1206 'cols', // type
