1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Always lowercase database names from 'host' and 'db' grant tables when they

are loaded and lower_case_table_names is set, but issue a warning when it is
done. (Bug #7989)


sql/sql_acl.cc:
  Lowercase database names in 'host' and 'db' grant tables when loading,
  but issue a warning to the log about them.
This commit is contained in:
unknown
2005-02-15 13:36:46 -08:00
parent 1b46843c10
commit 2d2d4df7d2
4 changed files with 86 additions and 0 deletions

View File

@ -0,0 +1 @@
--lower_case_table_names

View File

@ -0,0 +1,25 @@
# Test of grants when lower_case_table_names is on
use mysql;
# 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;