DB IDO: Ensure that queries are not executed if categories don't match

refs #12147
refs #12147
This commit is contained in:
Michael Friedrich 2016-08-02 14:27:20 +02:00
parent b7da28b176
commit 53930e321c
2 changed files with 14 additions and 10 deletions

View File

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

View File

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