1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-6896 kill user command cause MariaDB crash

mysql-test/r/kill-2.result:
  test case for MDEV-6896
mysql-test/t/kill-2-master.opt:
  test case for MDEV-6896
mysql-test/t/kill-2.test:
  test case for MDEV-6896
sql/sql_parse.cc:
  Use host_or_ip instead of host as host may be 0
This commit is contained in:
Michael Widenius
2014-12-15 13:01:11 +02:00
parent 4a32d9c058
commit 80ee57a30a
4 changed files with 41 additions and 1 deletions

View File

@ -6745,7 +6745,7 @@ static uint kill_threads_for_user(THD *thd, LEX_USER *user,
host.str[0] == '%' means that host name was not given. See sql_yacc.yy
*/
if (((user->host.str[0] == '%' && !user->host.str[1]) ||
!strcmp(tmp->security_ctx->host, user->host.str)) &&
!strcmp(tmp->security_ctx->host_or_ip, user->host.str)) &&
!strcmp(tmp->security_ctx->user, user->user.str))
{
if (!(thd->security_ctx->master_access & SUPER_ACL) &&