From 5f83b07fc216438889404447ee6b7202d20d334f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 7 Jan 2019 09:58:28 +0200 Subject: [PATCH 1/2] MXS-2241: Detect invalid readwritesplit configuration master_reconnection and disable_sescmd_history are, in practice, mutually exclusive settings. --- server/modules/routing/readwritesplit/readwritesplit.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/modules/routing/readwritesplit/readwritesplit.cc b/server/modules/routing/readwritesplit/readwritesplit.cc index b71c062c7..54c9f7bd9 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.cc +++ b/server/modules/routing/readwritesplit/readwritesplit.cc @@ -228,6 +228,13 @@ RWSplit* RWSplit::create(SERVICE* service, MXS_CONFIG_PARAMETER* params) return NULL; } + if (config.master_reconnection && config.disable_sescmd_history) + { + MXS_ERROR("Both 'master_reconnection' and 'disable_sescmd_history' are enabled: " + "Master reconnection cannot be done without session command history."); + return NULL; + } + return new(std::nothrow) RWSplit(service, config); } From 63358fb4c1ebfb7ccee3c8d2945083380f7a1561 Mon Sep 17 00:00:00 2001 From: Esa Korhonen Date: Fri, 4 Jan 2019 17:53:38 +0200 Subject: [PATCH 2/2] Add correct operator to comparison The clause had a bitwise AND. The end result is likely the same. --- server/modules/routing/schemarouter/schemaroutersession.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/modules/routing/schemarouter/schemaroutersession.cc b/server/modules/routing/schemarouter/schemaroutersession.cc index aa6f2332c..f17fcc9a3 100644 --- a/server/modules/routing/schemarouter/schemaroutersession.cc +++ b/server/modules/routing/schemarouter/schemaroutersession.cc @@ -1393,8 +1393,7 @@ void SchemaRouterSession::query_databases() for (SSRBackendList::iterator it = m_backends.begin(); it != m_backends.end(); it++) { - if ((*it)->in_use() && !(*it)->is_closed() - & server_is_usable((*it)->backend()->server)) + if ((*it)->in_use() && !(*it)->is_closed() && server_is_usable((*it)->backend()->server)) { GWBUF* clone = gwbuf_clone(buffer); MXS_ABORT_IF_NULL(clone);