Loading mysql-test/r/grant.result +18 −0 Original line number Diff line number Diff line Loading @@ -131,3 +131,21 @@ Wrong usage of DB GRANT and GLOBAL PRIVILEGES select 1; 1 1 insert into mysql.user (host, user) values ('localhost', 'test11'); insert into mysql.db (host, db, user, select_priv) values ('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y'); flush privileges; show grants for test11@localhost; Grants for test11@localhost GRANT USAGE ON *.* TO 'test11'@'localhost' GRANT SELECT ON `ab%`.* TO 'test11'@'localhost' GRANT SELECT ON `a%`.* TO 'test11'@'localhost' alter table mysql.db order by db desc; flush privileges; show grants for test11@localhost; Grants for test11@localhost GRANT USAGE ON *.* TO 'test11'@'localhost' GRANT SELECT ON `ab%`.* TO 'test11'@'localhost' GRANT SELECT ON `a%`.* TO 'test11'@'localhost' delete from mysql.user where user='test11'; delete from mysql.db where user='test11'; mysql-test/t/grant.test +15 −0 Original line number Diff line number Diff line Loading @@ -89,3 +89,18 @@ drop table t1; --error 1221 GRANT FILE on mysqltest.* to mysqltest_1@localhost; select 1; -- To test that the previous command didn't cause problems # # Bug #4898: User privileges depending on ORDER BY Settings of table db # insert into mysql.user (host, user) values ('localhost', 'test11'); insert into mysql.db (host, db, user, select_priv) values ('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y'); flush privileges; show grants for test11@localhost; alter table mysql.db order by db desc; flush privileges; show grants for test11@localhost; delete from mysql.user where user='test11'; delete from mysql.db where user='test11'; Loading
mysql-test/r/grant.result +18 −0 Original line number Diff line number Diff line Loading @@ -131,3 +131,21 @@ Wrong usage of DB GRANT and GLOBAL PRIVILEGES select 1; 1 1 insert into mysql.user (host, user) values ('localhost', 'test11'); insert into mysql.db (host, db, user, select_priv) values ('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y'); flush privileges; show grants for test11@localhost; Grants for test11@localhost GRANT USAGE ON *.* TO 'test11'@'localhost' GRANT SELECT ON `ab%`.* TO 'test11'@'localhost' GRANT SELECT ON `a%`.* TO 'test11'@'localhost' alter table mysql.db order by db desc; flush privileges; show grants for test11@localhost; Grants for test11@localhost GRANT USAGE ON *.* TO 'test11'@'localhost' GRANT SELECT ON `ab%`.* TO 'test11'@'localhost' GRANT SELECT ON `a%`.* TO 'test11'@'localhost' delete from mysql.user where user='test11'; delete from mysql.db where user='test11';
mysql-test/t/grant.test +15 −0 Original line number Diff line number Diff line Loading @@ -89,3 +89,18 @@ drop table t1; --error 1221 GRANT FILE on mysqltest.* to mysqltest_1@localhost; select 1; -- To test that the previous command didn't cause problems # # Bug #4898: User privileges depending on ORDER BY Settings of table db # insert into mysql.user (host, user) values ('localhost', 'test11'); insert into mysql.db (host, db, user, select_priv) values ('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y'); flush privileges; show grants for test11@localhost; alter table mysql.db order by db desc; flush privileges; show grants for test11@localhost; delete from mysql.user where user='test11'; delete from mysql.db where user='test11';