mirror of https://github.com/Icinga/icinga2.git
DB IDO: Ensure that queries are not executed if categories don't match
refs #12147 refs #12147
This commit is contained in:
parent
b7da28b176
commit
53930e321c
|
@ -894,17 +894,19 @@ void IdoMysqlConnection::InternalExecuteQuery(const DbQuery& query, DbQueryType
|
|||
return;
|
||||
}
|
||||
|
||||
if (!CanExecuteQuery(query)) {
|
||||
m_QueryQueue.Enqueue(boost::bind(&IdoMysqlConnection::InternalExecuteQuery, this, query, typeOverride), query.Priority);
|
||||
return;
|
||||
}
|
||||
|
||||
/* check whether we're allowed to execute the query first */
|
||||
if (GetCategoryFilter() != DbCatEverything && (query.Category & GetCategoryFilter()) == 0)
|
||||
return;
|
||||
|
||||
if (query.Object && query.Object->GetObject()->GetExtension("agent_check").ToBool())
|
||||
return;
|
||||
|
||||
/* check if there are missing object/insert ids and re-enqueue the query */
|
||||
if (!CanExecuteQuery(query)) {
|
||||
m_QueryQueue.Enqueue(boost::bind(&IdoMysqlConnection::InternalExecuteQuery, this, query, typeOverride), query.Priority);
|
||||
return;
|
||||
}
|
||||
|
||||
std::ostringstream qbuf, where;
|
||||
int type;
|
||||
|
||||
|
|
|
@ -751,17 +751,19 @@ void IdoPgsqlConnection::InternalExecuteQuery(const DbQuery& query, DbQueryType
|
|||
return;
|
||||
}
|
||||
|
||||
if (!CanExecuteQuery(query)) {
|
||||
m_QueryQueue.Enqueue(boost::bind(&IdoPgsqlConnection::InternalExecuteQuery, this, query, typeOverride), query.Priority);
|
||||
return;
|
||||
}
|
||||
|
||||
/* check whether we're allowed to execute the query first */
|
||||
if (GetCategoryFilter() != DbCatEverything && (query.Category & GetCategoryFilter()) == 0)
|
||||
return;
|
||||
|
||||
if (query.Object && query.Object->GetObject()->GetExtension("agent_check").ToBool())
|
||||
return;
|
||||
|
||||
/* check if there are missing object/insert ids and re-enqueue the query */
|
||||
if (!CanExecuteQuery(query)) {
|
||||
m_QueryQueue.Enqueue(boost::bind(&IdoPgsqlConnection::InternalExecuteQuery, this, query, typeOverride), query.Priority);
|
||||
return;
|
||||
}
|
||||
|
||||
std::ostringstream qbuf, where;
|
||||
int type;
|
||||
|
||||
|
|
Loading…
Reference in New Issue