[icinga-checkins] icinga.org: icingaweb2/master: Use automatically a subquery when counting with groups

git at icinga.org git at icinga.org
Thu Nov 13 16:45:15 CET 2014


Module: icingaweb2
Branch: master
Commit: 0e340015686a95e80062f9f08a6705ad3a276de2
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=0e340015686a95e80062f9f08a6705ad3a276de2

Author: Eric Lippmann <eric.lippmann at netways.de>
Date:   Thu Nov 13 16:33:10 2014 +0100

Use automatically a subquery when counting with groups

---

 library/Icinga/Data/Db/DbQuery.php |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/library/Icinga/Data/Db/DbQuery.php b/library/Icinga/Data/Db/DbQuery.php
index 56118ed..50bdecf 100644
--- a/library/Icinga/Data/Db/DbQuery.php
+++ b/library/Icinga/Data/Db/DbQuery.php
@@ -269,7 +269,7 @@ class DbQuery extends SimpleQuery
         $count = $this->dbSelect();
 
         $this->applyFilterSql($count);
-        if ($this->useSubqueryCount) {
+        if ($this->useSubqueryCount || $this->group) {
             $count->columns($this->columns);
             $columns = array('cnt' => 'COUNT(*)');
             return $this->db->select()->from($count, $columns);



More information about the icinga-checkins mailing list