diff options
-rw-r--r-- | mysql-test/r/grant.result | 11 | ||||
-rw-r--r-- | mysql-test/t/grant.test | 10 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 6 |
3 files changed, 27 insertions, 0 deletions
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 6831ef6183d..f6277323964 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -1429,3 +1429,14 @@ DROP USER 'testbug'@localhost; DROP TABLE db2.t1; DROP DATABASE db1; DROP DATABASE db2; +# +# Bug #36742 +# +grant usage on Foo.* to myuser@Localhost identified by 'foo'; +grant select on Foo.* to myuser@localhost; +select host,user from mysql.user where User='myuser'; +host user +localhost myuser +revoke select on Foo.* from myuser@localhost; +delete from mysql.user where User='myuser'; +flush privileges; diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index cb8d3c63be8..2fafeb7d264 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -1550,5 +1550,15 @@ DROP TABLE db2.t1; DROP DATABASE db1; DROP DATABASE db2; +--echo # +--echo # Bug #36742 +--echo # +grant usage on Foo.* to myuser@Localhost identified by 'foo'; +grant select on Foo.* to myuser@localhost; +select host,user from mysql.user where User='myuser'; +revoke select on Foo.* from myuser@localhost; +delete from mysql.user where User='myuser'; +flush privileges; + # Wait till we reached the initial number of concurrent sessions --source include/wait_until_count_sessions.inc diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index aa41a408e5b..4e24e69af42 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -11567,6 +11567,12 @@ user: system_charset_info, 0) || check_host_name(&$$->host)) MYSQL_YYABORT; + /* + Convert hostname part of username to lowercase. + It's OK to use in-place lowercase as long as + the character set is utf8. + */ + my_casedn_str(system_charset_info, $$->host.str); } | CURRENT_USER optional_braces { |