mirror of https://github.com/Icinga/icinga2.git
parent
16de7f853b
commit
5d15e3b644
|
@ -339,6 +339,10 @@ bool IdoMysqlConnection::FieldToEscapedString(const String& key, const Value& va
|
|||
*result = static_cast<long>(m_InstanceID);
|
||||
return true;
|
||||
}
|
||||
if (key == "notification_id") {
|
||||
*result = static_cast<long>(m_LastNotificationID);
|
||||
return true;
|
||||
}
|
||||
|
||||
Value rawvalue = DbValue::ExtractValue(value);
|
||||
|
||||
|
@ -503,6 +507,10 @@ void IdoMysqlConnection::ExecuteQuery(const DbQuery& query)
|
|||
if (type == DbQueryInsert && query.ConfigUpdate)
|
||||
SetInsertID(query.Object, GetLastInsertID());
|
||||
}
|
||||
if (type == DbQueryInsert && query.Table == "notifications") { // FIXME remove hardcoded table name
|
||||
m_LastNotificationID = GetLastInsertID();
|
||||
Log(LogWarning, "db_ido", "saving contactnotification notification_id=" + Convert::ToString(static_cast<long>(m_LastNotificationID)));
|
||||
}
|
||||
}
|
||||
|
||||
void IdoMysqlConnection::CleanUpExecuteQuery(const String& table, const String& time_key, double time_value)
|
||||
|
|
|
@ -63,6 +63,7 @@ private:
|
|||
String m_InstanceDescription;
|
||||
|
||||
DbReference m_InstanceID;
|
||||
DbReference m_LastNotificationID;
|
||||
|
||||
boost::mutex m_ConnectionMutex;
|
||||
bool m_Connected;
|
||||
|
|
Loading…
Reference in New Issue