From 0f0776b2adf10f559bc5c2bbea95a4c5832a47f8 Mon Sep 17 00:00:00 2001 From: Daniele Sciascia Date: Thu, 8 Mar 2018 10:55:52 +0100 Subject: [PATCH] MDEV-13549 Fix and re-enable test galera.MW-286 This test failed to work properly because the fixes it came with were not merged from upstream. The test would fail with a spurious ER_LOCK_DEADLOCK error for a conflict that happened earlier in the test execution, while wsrep is disabled. The original fix was to set THD::wsrep_conflict_state only if wsrep is enabled (see wsrep_thd_set_conflict_state() in sql/wsrep_mysqld.cc) --- mysql-test/suite/galera/disabled.def | 1 - mysql-test/suite/galera/t/MW-286.test | 1 - sql/wsrep_mysqld.cc | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index d82d5dd2023..d61da97355d 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -48,7 +48,6 @@ galera_toi_ddl_nonconflicting : MDEV-13549 Galera test failures galera_parallel_simple : MDEV-13549 Galera test failures galera_admin : MDEV-13549 Galera test failures galera_var_max_ws_rows : MDEV-13549 Galera test failures 10.1 -MW-286 : MDEV-13549 Galera test failures 10.1 galera_as_master: MDEV-13549 Galera test failures 10.1 galera_pc_ignore_sb : MDEV-13549 Galera test failures 10.1 galera_lock_table : MDEV-13549 Galera test failures 10.1 diff --git a/mysql-test/suite/galera/t/MW-286.test b/mysql-test/suite/galera/t/MW-286.test index 08deb317fbe..1b2e322f078 100644 --- a/mysql-test/suite/galera/t/MW-286.test +++ b/mysql-test/suite/galera/t/MW-286.test @@ -25,7 +25,6 @@ SET wsrep_on = FALSE; --error ER_QUERY_INTERRUPTED ALTER TABLE t1 ADD PRIMARY KEY (f1); -SET SESSION wsrep_sync_wait = 0; SET wsrep_on = TRUE; SET GLOBAL wsrep_desync = FALSE; diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 285bb520b87..9d4037082bc 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -2336,7 +2336,7 @@ extern "C" void wsrep_thd_set_query_state( void wsrep_thd_set_conflict_state(THD *thd, enum wsrep_conflict_state state) { - thd->wsrep_conflict_state= state; + if (WSREP(thd)) thd->wsrep_conflict_state= state; }