From c5dd2abf4ca26cb4ac6bfc3123500e5c2f46cbff Mon Sep 17 00:00:00 2001 From: sjaakola Date: Wed, 2 Mar 2016 21:32:06 +0200 Subject: [PATCH] Refs MW-245 - logic was wrong in detecting if queries are allowed in non primary node. it allowed select with no table list to execute even if dirty reads was not specified --- sql/sql_parse.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index c6adfd0999a..c1962508864 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2686,7 +2686,8 @@ mysql_execute_command(THD *thd) !(wsrep_ready && wsrep_reject_queries == WSREP_REJECT_NONE) && !(thd->variables.wsrep_dirty_reads && (sql_command_flags[lex->sql_command] & CF_CHANGES_DATA) == 0) && - !wsrep_tables_accessible_when_detached(all_tables) && + !(thd->variables.wsrep_dirty_reads && + wsrep_tables_accessible_when_detached(all_tables)) && lex->sql_command != SQLCOM_SET_OPTION && !wsrep_is_show_query(lex->sql_command)) {