Skip to content

Commit

Permalink
MDEV-6290 Crash in KILL HARD QUERY USER x@y when slave threads are ru…
Browse files Browse the repository at this point in the history
…nning

KILL USER should ignore system threads where sctx->user=sctx->host=NULL
  • Loading branch information
Sergei Golubchik committed Jul 23, 2014
1 parent 80708da commit 4e6e720
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions mysql-test/suite/rpl/r/kill_hard-6290.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include/master-slave.inc
[connection master]
kill user test2@nohost;
include/rpl_end.inc
11 changes: 11 additions & 0 deletions mysql-test/suite/rpl/t/kill_hard-6290.test
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion sql/sql_parse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7365,7 +7365,7 @@ static uint kill_threads_for_user(THD *thd, LEX_USER *user,
I_List_iterator<THD> 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.
Expand Down

0 comments on commit 4e6e720

Please sign in to comment.