[icinga-checkins] icinga.org: icinga-api/mhein/default: * Enabled some default joins to correct count values

git at icinga.org git at icinga.org
Wed Jul 28 10:21:54 CEST 2010


Module: icinga-api
Branch: mhein/default
Commit: bd9038c9b8f41392604ea252795839b0cb3b9648
URL:    https://git.icinga.org/?p=icinga-api.git;a=commit;h=bd9038c9b8f41392604ea252795839b0cb3b9648

Author: Marius Hein <marius.hein at netways.de>
Date:   Wed Jul 28 10:21:23 2010 +0200

* Enabled some default joins to correct count values

---

 .../data_interfaces/IcingaApiSearchIdoMysql.php    |   10 +++++-----
 .../data_interfaces/IcingaApiSearchIdoOci.php      |   10 +++++-----
 .../data_interfaces/IcingaApiSearchIdoOci8.php     |   10 +++++-----
 .../data_interfaces/IcingaApiSearchIdoPgsql.php    |   10 +++++-----
 4 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/objects/search/data_interfaces/IcingaApiSearchIdoMysql.php b/objects/search/data_interfaces/IcingaApiSearchIdoMysql.php
index 344156d..0f8295a 100644
--- a/objects/search/data_interfaces/IcingaApiSearchIdoMysql.php
+++ b/objects/search/data_interfaces/IcingaApiSearchIdoMysql.php
@@ -256,8 +256,8 @@ implements IcingaApiSearchIdoInterface {
 				${FIELDS}
 			from 
 				${TABLE_PREFIX}statehistory sh
-			${if_table:oh:inner join ${TABLE_PREFIX}objects oh on oh.object_id = sh.object_id and oh.objecttype_id = 1}
-			${if_table:h,oh:inner join ${TABLE_PREFIX}hosts h on h.host_object_id = oh.object_id}
+			inner join ${TABLE_PREFIX}objects oh on oh.object_id = sh.object_id and oh.objecttype_id = 1
+			inner join ${TABLE_PREFIX}hosts h on h.host_object_id = oh.object_id
 			${if_table:i,h:inner join ${TABLE_PREFIX}instances i on i.instance_id = h.instance_id}
 			${if_table:hcg,h:inner join ${TABLE_PREFIX}host_contactgroups hcg on hcg.host_id = h.host_id}
 			${if_table:cg,h:inner join ${TABLE_PREFIX}contactgroups cg on cg.contactgroup_object_id = hcg.contactgroup_object_id}
@@ -278,8 +278,8 @@ implements IcingaApiSearchIdoInterface {
 				${FIELDS}
 			from 
 				${TABLE_PREFIX}statehistory sh
-			${if_table:os:inner join ${TABLE_PREFIX}objects os on os.object_id = sh.object_id and os.objecttype_id = 2}
-			${if_table:s,os:inner join ${TABLE_PREFIX}services s on s.service_object_id = os.object_id}
+			inner join ${TABLE_PREFIX}objects os on os.object_id = sh.object_id and os.objecttype_id = 2
+			inner join ${TABLE_PREFIX}services s on s.service_object_id = os.object_id
 			${if_table:i,s:inner join ${TABLE_PREFIX}instances i on i.instance_id = s.instance_id}
 			${if_table:oh,s,os:inner join ${TABLE_PREFIX}objects oh on oh.object_id = s.host_object_id}
 			${if_table:h,oh,s,os:inner join ${TABLE_PREFIX}hosts h on h.host_object_id = oh.object_id}
@@ -316,7 +316,7 @@ implements IcingaApiSearchIdoInterface {
 				${FIELDS}
 			from
 				${TABLE_PREFIX}notifications n
-			${if_table:on:inner join ${TABLE_PREFIX}objects `on` on on.object_id = n.object_id and on.is_active = 1}
+			inner join ${TABLE_PREFIX}objects `on` on on.object_id = n.object_id and on.is_active = 1
 			${if_table:s,on:left join ${TABLE_PREFIX}services s on s.service_object_id = on.object_id}
 			${if_table:h,s,on:left join ${TABLE_PREFIX}hosts h on h.host_object_id = on.object_id or h.host_object_id = s.host_object_id}
 			${if_table:oh,h,s,on:left join ${TABLE_PREFIX}objects oh on oh.object_id = h.host_object_id}
diff --git a/objects/search/data_interfaces/IcingaApiSearchIdoOci.php b/objects/search/data_interfaces/IcingaApiSearchIdoOci.php
index 3fb8508..2697ad0 100644
--- a/objects/search/data_interfaces/IcingaApiSearchIdoOci.php
+++ b/objects/search/data_interfaces/IcingaApiSearchIdoOci.php
@@ -252,8 +252,8 @@ class IcingaApiSearchIdoOci
 				${FIELDS}
 			from 
 				${TABLE_PREFIX}statehistory sh
-			${if_table:oh:inner join ${TABLE_PREFIX}objects oh on oh.id = sh.object_id and oh.objecttype_id = 1}
-			${if_table:h,oh:inner join ${TABLE_PREFIX}hosts h on h.host_object_id = oh.instance_id}
+			inner join ${TABLE_PREFIX}objects oh on oh.id = sh.object_id and oh.objecttype_id = 1
+			inner join ${TABLE_PREFIX}hosts h on h.host_object_id = oh.instance_id
 			${if_table:i,h:inner join ${TABLE_PREFIX}instances i on i.id = h.id}
 			${if_table:hcg,h:inner join ${TABLE_PREFIX}host_contactgroups hcg on hcg.host_id = h.id}
 			${if_table:cg,h:inner join ${TABLE_PREFIX}contactgroups cg on cg.id = hcg.contactgroup_object_id}
@@ -275,8 +275,8 @@ class IcingaApiSearchIdoOci
 				${FIELDS}
 			from 
 				${TABLE_PREFIX}statehistory sh
-			${if_table:os:inner join ${TABLE_PREFIX}objects os on os.id = sh.object_id and os.objecttype_id = 2}
-			${if_table:s,os:inner join ${TABLE_PREFIX}services s on s.service_object_id = os.id}
+			inner join ${TABLE_PREFIX}objects os on os.id = sh.object_id and os.objecttype_id = 2
+			inner join ${TABLE_PREFIX}services s on s.service_object_id = os.id
 			${if_table:i,s:inner join ${TABLE_PREFIX}instances i on i.id = s.instance_id}
 			${if_table:oh,s,os:inner join ${TABLE_PREFIX}objects oh on oh.id = s.host_object_id}
 			${if_table:h,oh,s,os:inner join ${TABLE_PREFIX}hosts h on h.host_object_id = oh.id}
@@ -313,7 +313,7 @@ class IcingaApiSearchIdoOci
 				${FIELDS}
 			from
 				${TABLE_PREFIX}notifications n
-			${if_table:on:inner join ${TABLE_PREFIX}objects `on` on on.id = n.object_id and on.is_active = 1}
+			inner join ${TABLE_PREFIX}objects `on` on on.id = n.object_id and on.is_active = 1
 			${if_table:s,on:left join ${TABLE_PREFIX}services s on s.service_object_id = on.id}
 			${if_table:h,s,on:left join ${TABLE_PREFIX}hosts h on h.host_object_id = on.id or h.host_object_id = s.host_object_id}
 			${if_table:oh,h,s,on:left join ${TABLE_PREFIX}objects oh on oh.id = h.host_object_id}
diff --git a/objects/search/data_interfaces/IcingaApiSearchIdoOci8.php b/objects/search/data_interfaces/IcingaApiSearchIdoOci8.php
index fc22ae2..e0a5bcf 100644
--- a/objects/search/data_interfaces/IcingaApiSearchIdoOci8.php
+++ b/objects/search/data_interfaces/IcingaApiSearchIdoOci8.php
@@ -255,8 +255,8 @@ class IcingaApiSearchIdoOci8
 				${FIELDS}
 			from 
 				${TABLE_PREFIX}statehistory sh
-			${if_table:oh:inner join ${TABLE_PREFIX}objects oh on oh.id = sh.object_id and oh.objecttype_id = 1}
-			${if_table:h,oh:inner join ${TABLE_PREFIX}hosts h on h.host_object_id = oh.id}
+			inner join ${TABLE_PREFIX}objects oh on oh.id = sh.object_id and oh.objecttype_id = 1
+			inner join ${TABLE_PREFIX}hosts h on h.host_object_id = oh.id
 			${if_table:i,h:inner join ${TABLE_PREFIX}instances i on i.id = h.instance_id}
 			${if_table:hcg,h:inner join ${TABLE_PREFIX}host_contactgroups hcg on hcg.host_id = h.id}
 			${if_table:cg,h:inner join ${TABLE_PREFIX}contactgroups cg on cg.id = hcg.contactgroup_object_id}
@@ -278,8 +278,8 @@ class IcingaApiSearchIdoOci8
 				${FIELDS}
 			from 
 				${TABLE_PREFIX}statehistory sh
-			${if_table:os:inner join ${TABLE_PREFIX}objects os on os.id = sh.id and os.objecttype_id = 2}
-			${if_table:s,os:inner join ${TABLE_PREFIX}services s on s.service_object_id = os.id}
+			inner join ${TABLE_PREFIX}objects os on os.id = sh.id and os.objecttype_id = 2
+			inner join ${TABLE_PREFIX}services s on s.service_object_id = os.id
 			${if_table:i,s:inner join ${TABLE_PREFIX}instances i on i.id = s.instance_id}
 			${if_table:oh,s,os:inner join ${TABLE_PREFIX}objects oh on oh.id = s.host_object_id}
 			${if_table:h,oh,s,os:inner join ${TABLE_PREFIX}hosts h on h.host_object_id = oh.id}
@@ -316,7 +316,7 @@ class IcingaApiSearchIdoOci8
 				${FIELDS}
 			from
 				${TABLE_PREFIX}notifications n
-			${if_table:obn:inner join ${TABLE_PREFIX}objects obn on obn.id = n.object_id and obn.is_active = 1}
+			inner join ${TABLE_PREFIX}objects obn on obn.id = n.object_id and obn.is_active = 1
 			${if_table:s,obn:left join ${TABLE_PREFIX}services s on s.service_object_id = obn.id}
 			${if_table:h,s,obn:left join ${TABLE_PREFIX}hosts h on h.host_object_id = obn.id or h.host_object_id = s.host_object_id}
 			${if_table:oh,h,s,obn:left join ${TABLE_PREFIX}objects oh on oh.id = h.host_object_id}
diff --git a/objects/search/data_interfaces/IcingaApiSearchIdoPgsql.php b/objects/search/data_interfaces/IcingaApiSearchIdoPgsql.php
index 8ffb647..dd437b4 100644
--- a/objects/search/data_interfaces/IcingaApiSearchIdoPgsql.php
+++ b/objects/search/data_interfaces/IcingaApiSearchIdoPgsql.php
@@ -238,8 +238,8 @@ class IcingaApiSearchIdoPgsql
 				${FIELDS}
 			from 
 				${TABLE_PREFIX}statehistory sh
-			${if_table:oh:inner join ${TABLE_PREFIX}objects oh on oh.object_id = sh.object_id and oh.objecttype_id = 1}
-			${if_table:h,oh:inner join ${TABLE_PREFIX}hosts h on h.host_object_id = oh.object_id}
+			inner join ${TABLE_PREFIX}objects oh on oh.object_id = sh.object_id and oh.objecttype_id = 1
+			inner join ${TABLE_PREFIX}hosts h on h.host_object_id = oh.object_id
 			${if_table:i,h:inner join ${TABLE_PREFIX}instances i on i.instance_id = h.instance_id}
 			${if_table:hcg,h:inner join ${TABLE_PREFIX}host_contactgroups hcg on hcg.host_id = h.host_id}
 			${if_table:cg,h:inner join ${TABLE_PREFIX}contactgroups cg on cg.contactgroup_object_id = hcg.contactgroup_object_id}
@@ -259,8 +259,8 @@ class IcingaApiSearchIdoPgsql
 				${FIELDS}
 			from 
 				${TABLE_PREFIX}statehistory sh
-			${if_table:os:inner join ${TABLE_PREFIX}objects os on os.object_id = sh.object_id and os.objecttype_id = 2}
-			${if_table:s,os:inner join ${TABLE_PREFIX}services s on s.service_object_id = os.object_id}
+			inner join ${TABLE_PREFIX}objects os on os.object_id = sh.object_id and os.objecttype_id = 2
+			inner join ${TABLE_PREFIX}services s on s.service_object_id = os.object_id
 			${if_table:i,s:inner join ${TABLE_PREFIX}instances i on i.instance_id = s.instance_id}
 			${if_table:oh,s,os:inner join ${TABLE_PREFIX}objects oh on oh.object_id = s.host_object_id}
 			${if_table:h,oh,s,os:inner join ${TABLE_PREFIX}hosts h on h.host_object_id = oh.object_id}
@@ -296,7 +296,7 @@ class IcingaApiSearchIdoPgsql
 				${FIELDS}
 			from
 				${TABLE_PREFIX}notifications n
-			${if_table:on:inner join ${TABLE_PREFIX}objects obn on obn.object_id = n.object_id and obn.is_active = 1}
+			inner join ${TABLE_PREFIX}objects obn on obn.object_id = n.object_id and obn.is_active = 1
 			${if_table:s,on:left join ${TABLE_PREFIX}services s on s.service_object_id = obn.object_id}
 			${if_table:h,s,on:left join ${TABLE_PREFIX}hosts h on h.host_object_id = obn.object_id or h.host_object_id = s.host_object_id}
 			${if_table:oh,h,s,on:left join ${TABLE_PREFIX}objects oh on oh.object_id = h.host_object_id}





More information about the icinga-checkins mailing list