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 0000000000000..27b624163686e --- /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 0000000000000..7624235666a3e --- /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 2c833761e740d..43b10a6fb9ed2 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.