diff options
Diffstat (limited to 'mysql-test/main/lowercase_table_grant.test')
-rw-r--r-- | mysql-test/main/lowercase_table_grant.test | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/mysql-test/main/lowercase_table_grant.test b/mysql-test/main/lowercase_table_grant.test new file mode 100644 index 00000000000..2f98f570e29 --- /dev/null +++ b/mysql-test/main/lowercase_table_grant.test @@ -0,0 +1,31 @@ +# Don't test with embedded server +-- source include/not_embedded.inc + +# Test of grants when lower_case_table_names is on +use mysql; +set sql_mode=""; + +# mixed-case database name for testing +create database MYSQLtest; + +# check that database name gets forced to lowercase +grant all on MySQLtest.* to mysqltest_1@localhost; +show grants for mysqltest_1@localhost; + +# now force it to mixed case, but see that it is lowercased in the acl cache +select * from db where user = 'mysqltest_1'; +update db set db = 'MYSQLtest' where db = 'mysqltest' and user = 'mysqltest_1' and host = 'localhost'; +flush privileges; +show grants for mysqltest_1@localhost; +select * from db where user = 'mysqltest_1'; + +# clear out the user we created +# +# can't use REVOKE because of the mixed-case database name +delete from db where db = 'MYSQLtest' and user = 'mysqltest_1' and host = 'localhost'; +flush privileges; +drop user mysqltest_1@localhost; + +drop database MYSQLtest; + +# End of 4.1 tests |