mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-27 15:44:11 +02:00
parent
16de7f853b
commit
5d15e3b644
@ -339,6 +339,10 @@ bool IdoMysqlConnection::FieldToEscapedString(const String& key, const Value& va
|
|||||||
*result = static_cast<long>(m_InstanceID);
|
*result = static_cast<long>(m_InstanceID);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (key == "notification_id") {
|
||||||
|
*result = static_cast<long>(m_LastNotificationID);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
Value rawvalue = DbValue::ExtractValue(value);
|
Value rawvalue = DbValue::ExtractValue(value);
|
||||||
|
|
||||||
@ -503,6 +507,10 @@ void IdoMysqlConnection::ExecuteQuery(const DbQuery& query)
|
|||||||
if (type == DbQueryInsert && query.ConfigUpdate)
|
if (type == DbQueryInsert && query.ConfigUpdate)
|
||||||
SetInsertID(query.Object, GetLastInsertID());
|
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)
|
void IdoMysqlConnection::CleanUpExecuteQuery(const String& table, const String& time_key, double time_value)
|
||||||
|
@ -63,6 +63,7 @@ private:
|
|||||||
String m_InstanceDescription;
|
String m_InstanceDescription;
|
||||||
|
|
||||||
DbReference m_InstanceID;
|
DbReference m_InstanceID;
|
||||||
|
DbReference m_LastNotificationID;
|
||||||
|
|
||||||
boost::mutex m_ConnectionMutex;
|
boost::mutex m_ConnectionMutex;
|
||||||
bool m_Connected;
|
bool m_Connected;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user