From c0c6ea545b91086ed1628cc349dadad2581f5828 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Tue, 30 Oct 2018 13:17:28 +0100 Subject: [PATCH] DB IDO: Don't enqueue queries when the feature is paused (HA) fixes #5876 refs #6739 --- lib/db_ido_mysql/idomysqlconnection.cpp | 33 +++++++++++++++++++++++++ lib/db_ido_pgsql/idopgsqlconnection.cpp | 24 ++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/lib/db_ido_mysql/idomysqlconnection.cpp b/lib/db_ido_mysql/idomysqlconnection.cpp index 1a13b89cc..9bbbeb0df 100644 --- a/lib/db_ido_mysql/idomysqlconnection.cpp +++ b/lib/db_ido_mysql/idomysqlconnection.cpp @@ -162,6 +162,9 @@ void IdoMysqlConnection::TxTimerHandler() void IdoMysqlConnection::NewTransaction() { + if (IsPaused()) + return; + #ifdef I2_DEBUG /* I2_DEBUG */ Log(LogDebug, "IdoMysqlConnection") << "Scheduling new transaction and finishing async queries."; @@ -715,6 +718,9 @@ void IdoMysqlConnection::DiscardRows(const IdoMysqlResult& result) void IdoMysqlConnection::ActivateObject(const DbObject::Ptr& dbobj) { + if (IsPaused()) + return; + #ifdef I2_DEBUG /* I2_DEBUG */ Log(LogDebug, "IdoMysqlConnection") << "Scheduling object activation task for '" << dbobj->GetName1() << "!" << dbobj->GetName2() << "'."; @@ -727,6 +733,9 @@ void IdoMysqlConnection::InternalActivateObject(const DbObject::Ptr& dbobj) { AssertOnWorkQueue(); + if (IsPaused()) + return; + if (!GetConnected()) return; @@ -754,6 +763,9 @@ void IdoMysqlConnection::InternalActivateObject(const DbObject::Ptr& dbobj) void IdoMysqlConnection::DeactivateObject(const DbObject::Ptr& dbobj) { + if (IsPaused()) + return; + #ifdef I2_DEBUG /* I2_DEBUG */ Log(LogDebug, "IdoMysqlConnection") << "Scheduling object deactivation task for '" << dbobj->GetName1() << "!" << dbobj->GetName2() << "'."; @@ -766,6 +778,9 @@ void IdoMysqlConnection::InternalDeactivateObject(const DbObject::Ptr& dbobj) { AssertOnWorkQueue(); + if (IsPaused()) + return; + if (!GetConnected()) return; @@ -855,6 +870,9 @@ bool IdoMysqlConnection::FieldToEscapedString(const String& key, const Value& va void IdoMysqlConnection::ExecuteQuery(const DbQuery& query) { + if (IsPaused()) + return; + ASSERT(query.Category != DbCatInvalid); #ifdef I2_DEBUG /* I2_DEBUG */ @@ -867,6 +885,9 @@ void IdoMysqlConnection::ExecuteQuery(const DbQuery& query) void IdoMysqlConnection::ExecuteMultipleQueries(const std::vector& queries) { + if (IsPaused()) + return; + if (queries.empty()) return; @@ -914,6 +935,9 @@ void IdoMysqlConnection::InternalExecuteMultipleQueries(const std::vector& queries) { + if (IsPaused()) + return; + if (queries.empty()) return; @@ -748,6 +763,9 @@ void IdoPgsqlConnection::InternalExecuteMultipleQueries(const std::vector