Commit 57a43b84 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-6625 SHOW GRANTS for current_user_name@wrong_host_name

parent b5ebc211
SHOW GRANTS FOR root@invalid_host;
ERROR 42000: There is no such grant defined for user 'root' on host 'invalid_host'
-- source include/not_embedded.inc
#
# MDEV-6625 SHOW GRANTS for current_user_name@wrong_host_name
#
--error ER_NONEXISTING_GRANT
SHOW GRANTS FOR root@invalid_host;
......@@ -4335,8 +4335,9 @@ end_with_restore_list:
if (!grant_user)
goto error;
if (grant_user->user.str &&
!strcmp(thd->security_ctx->priv_user, grant_user->user.str))
if (grant_user->user.str && grant_user->host.str &&
!strcmp(thd->security_ctx->priv_user, grant_user->user.str) &&
!strcmp(thd->security_ctx->priv_host, grant_user->host.str))
grant_user->user= current_user;
if (grant_user->user.str == current_user.str ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment