From 4e6e720160d983752465323477d74a1c90bad0cd Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 23 Jul 2014 19:36:15 +0200 Subject: [PATCH] MDEV-6290 Crash in KILL HARD QUERY USER x@y when slave threads are running KILL USER should ignore system threads where sctx->user=sctx->host=NULL --- mysql-test/suite/rpl/r/kill_hard-6290.result | 4 ++++ mysql-test/suite/rpl/t/kill_hard-6290.test | 11 +++++++++++ sql/sql_parse.cc | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 mysql-test/suite/rpl/r/kill_hard-6290.result create mode 100644 mysql-test/suite/rpl/t/kill_hard-6290.test diff --git a/mysql-test/suite/rpl/r/kill_hard-6290.result b/mysql-test/suite/rpl/r/kill_hard-6290.result new file mode 100644 index 00000000000..27b62416368 --- /dev/null +++ b/mysql-test/suite/rpl/r/kill_hard-6290.result @@ -0,0 +1,4 @@ +include/master-slave.inc +[connection master] +kill user test2@nohost; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/kill_hard-6290.test b/mysql-test/suite/rpl/t/kill_hard-6290.test new file mode 100644 index 00000000000..7624235666a --- /dev/null +++ b/mysql-test/suite/rpl/t/kill_hard-6290.test @@ -0,0 +1,11 @@ +# +# MDEV-6290 Crash in KILL HARD QUERY USER x@y when slave threads are running +# + +# this test doesn't depend on the binlog format, no need to run it three times +--source include/have_binlog_format_mixed.inc + +--source include/master-slave.inc +--connection server_2 +kill user test2@nohost; +--source include/rpl_end.inc diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 2c833761e74..43b10a6fb9e 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -7365,7 +7365,7 @@ static uint kill_threads_for_user(THD *thd, LEX_USER *user, I_List_iterator it(threads); while ((tmp=it++)) { - if (tmp->command == COM_DAEMON) + if (!tmp->security_ctx->user) continue; /* Check that hostname (if given) and user name matches.