mirror of https://github.com/Icinga/icinga2.git
ido: Don't update insert IDs for status updates (2nd attempt).
This commit is contained in:
parent
9b70b7eb14
commit
bd5e452c6f
|
@ -426,6 +426,6 @@ void MysqlDbConnection::ExecuteQuery(const DbQuery& query)
|
|||
|
||||
Query(qbuf.str());
|
||||
|
||||
if (type == DbQueryInsert && query.Object)
|
||||
if (type == DbQueryInsert && query.Object && query.UpdateObjectID)
|
||||
SetInsertID(query.Object, GetLastInsertID());
|
||||
}
|
||||
|
|
|
@ -89,6 +89,7 @@ void DbObject::SendConfigUpdate(void)
|
|||
query.WhereCriteria = boost::make_shared<Dictionary>();
|
||||
query.WhereCriteria->Set(GetType()->GetIDColumn(), GetObject());
|
||||
query.Object = GetSelf();
|
||||
query.UpdateObjectID = true;
|
||||
OnQuery(query);
|
||||
|
||||
m_LastConfigUpdate = Utility::GetTime();
|
||||
|
@ -113,6 +114,7 @@ void DbObject::SendStatusUpdate(void)
|
|||
query.WhereCriteria = boost::make_shared<Dictionary>();
|
||||
query.WhereCriteria->Set(GetType()->GetIDColumn(), GetObject());
|
||||
query.Object = GetSelf();
|
||||
query.UpdateObjectID = false;
|
||||
OnQuery(query);
|
||||
|
||||
m_LastStatusUpdate = Utility::GetTime();
|
||||
|
|
|
@ -41,6 +41,7 @@ struct DbQuery
|
|||
Dictionary::Ptr Fields;
|
||||
Dictionary::Ptr WhereCriteria;
|
||||
boost::shared_ptr<DbObject> Object;
|
||||
bool UpdateObjectID;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue