diff options
author | Dmitry Shulga <Dmitry.Shulga@Sun.COM> | 2010-10-13 13:27:03 +0700 |
---|---|---|
committer | Dmitry Shulga <Dmitry.Shulga@Sun.COM> | 2010-10-13 13:27:03 +0700 |
commit | 333434d23b9c4a5df3d1d26e26dfedb808e4b6ff (patch) | |
tree | fac656384003e2158a9d528276a2f732302b3fb4 | |
parent | cd81c833a8a27df3cf037e084917a1a58e76f70b (diff) | |
parent | 8169faec2797511e649bd98329c69a6cb0c9a857 (diff) | |
download | mariadb-git-333434d23b9c4a5df3d1d26e26dfedb808e4b6ff.tar.gz |
Auto-merge from mysql-5.1-bugteam for bug#36742.
-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 84cac386b57..84a731d4bb4 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -1577,6 +1577,17 @@ 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; ######################################################################### # # Bug#38347: ALTER ROUTINE privilege allows SHOW CREATE TABLE. diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index e73f45a6c53..c2bf7f21ffa 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -1578,6 +1578,16 @@ 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 d73dff9aaeb..396c426f29f 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -12334,6 +12334,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 { |