ido: Don't update insert IDs for status updates (2nd attempt).

This commit is contained in:
Gunnar Beutner 2013-08-02 09:58:51 +02:00
parent 9b70b7eb14
commit bd5e452c6f
3 changed files with 4 additions and 1 deletions

View File

@ -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());
}

View File

@ -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();

View File

@ -41,6 +41,7 @@ struct DbQuery
Dictionary::Ptr Fields;
Dictionary::Ptr WhereCriteria;
boost::shared_ptr<DbObject> Object;
bool UpdateObjectID;
};
}