DB IDO: Add object_id where clause for icinga_downtimehistory

fixes #10110
This commit is contained in:
Michael Friedrich 2015-10-28 17:12:23 +01:00
parent 5ad0c67485
commit de8aae90e4
1 changed files with 2 additions and 2 deletions

View File

@ -574,6 +574,7 @@ void DbEvents::RemoveDowntime(const Checkable::Ptr& checkable, const Downtime::P
query1.WhereCriteria = new Dictionary(); query1.WhereCriteria = new Dictionary();
query1.WhereCriteria->Set("object_id", checkable); query1.WhereCriteria->Set("object_id", checkable);
query1.WhereCriteria->Set("internal_downtime_id", downtime->GetLegacyId()); query1.WhereCriteria->Set("internal_downtime_id", downtime->GetLegacyId());
query1.WhereCriteria->Set("instance_id", 0); /* DbConnection class fills in real ID */
DbObject::OnQuery(query1); DbObject::OnQuery(query1);
/* History - update actual_end_time, was_cancelled for service (and host in case) */ /* History - update actual_end_time, was_cancelled for service (and host in case) */
@ -592,10 +593,9 @@ void DbEvents::RemoveDowntime(const Checkable::Ptr& checkable, const Downtime::P
query3.Fields = fields3; query3.Fields = fields3;
query3.WhereCriteria = new Dictionary(); query3.WhereCriteria = new Dictionary();
query3.WhereCriteria->Set("object_id", checkable);
query3.WhereCriteria->Set("internal_downtime_id", downtime->GetLegacyId()); query3.WhereCriteria->Set("internal_downtime_id", downtime->GetLegacyId());
query3.WhereCriteria->Set("entry_time", DbValue::FromTimestamp(downtime->GetEntryTime())); query3.WhereCriteria->Set("entry_time", DbValue::FromTimestamp(downtime->GetEntryTime()));
query3.WhereCriteria->Set("scheduled_start_time", DbValue::FromTimestamp(downtime->GetStartTime()));
query3.WhereCriteria->Set("scheduled_end_time", DbValue::FromTimestamp(downtime->GetEndTime()));
query3.WhereCriteria->Set("instance_id", 0); /* DbConnection class fills in real ID */ query3.WhereCriteria->Set("instance_id", 0); /* DbConnection class fills in real ID */
DbObject::OnQuery(query3); DbObject::OnQuery(query3);