mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 23:24:09 +02:00
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());
|
Query(qbuf.str());
|
||||||
|
|
||||||
if (type == DbQueryInsert && query.Object)
|
if (type == DbQueryInsert && query.Object && query.UpdateObjectID)
|
||||||
SetInsertID(query.Object, GetLastInsertID());
|
SetInsertID(query.Object, GetLastInsertID());
|
||||||
}
|
}
|
||||||
|
@ -89,6 +89,7 @@ void DbObject::SendConfigUpdate(void)
|
|||||||
query.WhereCriteria = boost::make_shared<Dictionary>();
|
query.WhereCriteria = boost::make_shared<Dictionary>();
|
||||||
query.WhereCriteria->Set(GetType()->GetIDColumn(), GetObject());
|
query.WhereCriteria->Set(GetType()->GetIDColumn(), GetObject());
|
||||||
query.Object = GetSelf();
|
query.Object = GetSelf();
|
||||||
|
query.UpdateObjectID = true;
|
||||||
OnQuery(query);
|
OnQuery(query);
|
||||||
|
|
||||||
m_LastConfigUpdate = Utility::GetTime();
|
m_LastConfigUpdate = Utility::GetTime();
|
||||||
@ -113,6 +114,7 @@ void DbObject::SendStatusUpdate(void)
|
|||||||
query.WhereCriteria = boost::make_shared<Dictionary>();
|
query.WhereCriteria = boost::make_shared<Dictionary>();
|
||||||
query.WhereCriteria->Set(GetType()->GetIDColumn(), GetObject());
|
query.WhereCriteria->Set(GetType()->GetIDColumn(), GetObject());
|
||||||
query.Object = GetSelf();
|
query.Object = GetSelf();
|
||||||
|
query.UpdateObjectID = false;
|
||||||
OnQuery(query);
|
OnQuery(query);
|
||||||
|
|
||||||
m_LastStatusUpdate = Utility::GetTime();
|
m_LastStatusUpdate = Utility::GetTime();
|
||||||
|
@ -41,6 +41,7 @@ struct DbQuery
|
|||||||
Dictionary::Ptr Fields;
|
Dictionary::Ptr Fields;
|
||||||
Dictionary::Ptr WhereCriteria;
|
Dictionary::Ptr WhereCriteria;
|
||||||
boost::shared_ptr<DbObject> Object;
|
boost::shared_ptr<DbObject> Object;
|
||||||
|
bool UpdateObjectID;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user