summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2020-03-26 19:19:41 +0400
committerSergey Vojtovich <svoj@mariadb.org>2020-03-26 19:19:41 +0400
commitba679ae52f0e9d698c1b36d28a5bc8c233e57a2e (patch)
tree6a3f82dd8c60442ce288b41d113fbe6af3d2c1be
parentaf4b2ae8588bd51cc17e66cfc8210c3225992fbe (diff)
downloadmariadb-git-ba679ae52f0e9d698c1b36d28a5bc8c233e57a2e.tar.gz
Fix for rpl_start_stop_slave failure
One may access freed THD members after LOCK_thd_kill is released. With original code it can happen when killing wsrep-disabled thread on a wsrep-enabled server. With 91ab42a8 it is happening on a wsrep-disabled server.
-rw-r--r--sql/sql_parse.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 9af4afd4b03..ffba46b4573 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -9086,8 +9086,8 @@ kill_one_thread(THD *thd, longlong id, killed_state kill_signal, killed_type typ
else
error= (type == KILL_TYPE_QUERY ? ER_KILL_QUERY_DENIED_ERROR :
ER_KILL_DENIED_ERROR);
- mysql_mutex_unlock(&tmp->LOCK_thd_kill);
if (WSREP(tmp)) mysql_mutex_unlock(&tmp->LOCK_thd_data);
+ mysql_mutex_unlock(&tmp->LOCK_thd_kill);
}
DBUG_PRINT("exit", ("%d", error));
DBUG_RETURN(error);