summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 4070a833f82..30fcac6e12a 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -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 ||