Commit fafb35ee authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

MDEV-20076: SHOW GRANTS does not quote role names properly

Quotes added to output.
parent b3ded219
......@@ -108,12 +108,12 @@ update mysql.user set password=old_password("gambling2") where user=_binary"test
flush privileges;
show grants for test@localhost;
Grants for test@localhost
GRANT ALL PRIVILEGES ON *.* TO 'test'@'localhost' IDENTIFIED BY PASSWORD '2f27438961437573'
GRANT ALL PRIVILEGES ON *.* TO `test`@`localhost` IDENTIFIED BY PASSWORD '2f27438961437573'
update mysql.user set plugin='mysql_old_password' where user='test';
flush privileges;
show grants for test@localhost;
Grants for test@localhost
GRANT ALL PRIVILEGES ON *.* TO 'test'@'localhost' IDENTIFIED BY PASSWORD '2f27438961437573'
GRANT ALL PRIVILEGES ON *.* TO `test`@`localhost` IDENTIFIED BY PASSWORD '2f27438961437573'
connect con10,localhost,test,gambling2,;
connect con5,localhost,test,gambling2,mysql;
connection con5;
......
......@@ -618,7 +618,7 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
USE test;
SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
SET GLOBAL event_scheduler = ON;
CREATE TABLE events_test.event_log
......@@ -632,9 +632,9 @@ GRANT create, insert, select, event ON events_test.* TO evtest1@localhost;
GRANT select,insert ON test.* TO evtest1@localhost;
SHOW GRANTS FOR evtest1@localhost;
Grants for evtest1@localhost
GRANT USAGE ON *.* TO 'evtest1'@'localhost' IDENTIFIED BY PASSWORD '*3170F3644E31580C25DE4A08F4C07CC9A2D40C32'
GRANT SELECT, INSERT ON `test`.* TO 'evtest1'@'localhost'
GRANT SELECT, INSERT, CREATE, EVENT ON `events_test`.* TO 'evtest1'@'localhost'
GRANT USAGE ON *.* TO `evtest1`@`localhost` IDENTIFIED BY PASSWORD '*3170F3644E31580C25DE4A08F4C07CC9A2D40C32'
GRANT SELECT, INSERT ON `test`.* TO `evtest1`@`localhost`
GRANT SELECT, INSERT, CREATE, EVENT ON `events_test`.* TO `evtest1`@`localhost`
connect e1,localhost,evtest1,ev1,events_test,$MASTER_MYPORT,$MASTER_MYSOCK;
CREATE EVENT ev_sched_1823 ON SCHEDULE EVERY 2 SECOND
DO BEGIN
......
......@@ -23,9 +23,9 @@ USER() DATABASE()
ev_test@localhost events_test2
SHOW GRANTS;
Grants for ev_test@localhost
GRANT USAGE ON *.* TO 'ev_test'@'localhost'
GRANT ALL PRIVILEGES ON `events_test`.* TO 'ev_test'@'localhost'
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, TRIGGER, DELETE HISTORY ON `events_test2`.* TO 'ev_test'@'localhost'
GRANT USAGE ON *.* TO `ev_test`@`localhost`
GRANT ALL PRIVILEGES ON `events_test`.* TO `ev_test`@`localhost`
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, TRIGGER, DELETE HISTORY ON `events_test2`.* TO `ev_test`@`localhost`
"Here comes an error:";
SHOW EVENTS;
ERROR 42000: Access denied for user 'ev_test'@'localhost' to database 'events_test2'
......
......@@ -10,25 +10,25 @@ SELECT * FROM testdb.t1;
GRANT CREATE VIEW, SHOW VIEW ON testdb.v1 TO 'show_view_tbl'@'localhost';
SHOW GRANTS FOR 'show_view_tbl'@'localhost';
Grants for show_view_tbl@localhost
GRANT USAGE ON *.* TO 'show_view_tbl'@'localhost'
GRANT CREATE VIEW, SHOW VIEW ON `testdb`.`v1` TO 'show_view_tbl'@'localhost'
GRANT USAGE ON *.* TO `show_view_tbl`@`localhost`
GRANT CREATE VIEW, SHOW VIEW ON `testdb`.`v1` TO `show_view_tbl`@`localhost`
GRANT SELECT(c1) on testdb.v1 to 'select_only_c1'@localhost;
SHOW GRANTS FOR 'select_only_c1'@'localhost';
Grants for select_only_c1@localhost
GRANT USAGE ON *.* TO 'select_only_c1'@'localhost'
GRANT SELECT (c1) ON `testdb`.`v1` TO 'select_only_c1'@'localhost'
GRANT USAGE ON *.* TO `select_only_c1`@`localhost`
GRANT SELECT (c1) ON `testdb`.`v1` TO `select_only_c1`@`localhost`
"after fix privs"
SHOW GRANTS FOR 'show_view_tbl'@'localhost';
Grants for show_view_tbl@localhost
GRANT USAGE ON *.* TO 'show_view_tbl'@'localhost'
GRANT CREATE VIEW, SHOW VIEW ON `testdb`.`v1` TO 'show_view_tbl'@'localhost'
GRANT USAGE ON *.* TO `show_view_tbl`@`localhost`
GRANT CREATE VIEW, SHOW VIEW ON `testdb`.`v1` TO `show_view_tbl`@`localhost`
SHOW GRANTS FOR 'select_only_c1'@'localhost';
Grants for select_only_c1@localhost
GRANT USAGE ON *.* TO 'select_only_c1'@'localhost'
GRANT SELECT (c1) ON `testdb`.`v1` TO 'select_only_c1'@'localhost'
GRANT USAGE ON *.* TO `select_only_c1`@`localhost`
GRANT SELECT (c1) ON `testdb`.`v1` TO `select_only_c1`@`localhost`
DROP USER 'show_view_tbl'@'localhost';
DROP USER 'select_only_c1'@'localhost';
......
This diff is collapsed.
......@@ -59,12 +59,12 @@ disconnect user1;
connection default;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT CREATE USER ON *.* TO 'mysqltest_1'@'localhost'
GRANT ALL PRIVILEGES ON `my\_%`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION
GRANT CREATE USER ON *.* TO `mysqltest_1`@`localhost`
GRANT ALL PRIVILEGES ON `my\_%`.* TO `mysqltest_1`@`localhost` WITH GRANT OPTION
show grants for mysqltest_2@localhost;
Grants for mysqltest_2@localhost
GRANT USAGE ON *.* TO 'mysqltest_2'@'localhost'
GRANT ALL PRIVILEGES ON `my\_1`.* TO 'mysqltest_2'@'localhost' WITH GRANT OPTION
GRANT USAGE ON *.* TO `mysqltest_2`@`localhost`
GRANT ALL PRIVILEGES ON `my\_1`.* TO `mysqltest_2`@`localhost` WITH GRANT OPTION
show grants for mysqltest_3@localhost;
ERROR 42000: There is no such grant defined for user 'mysqltest_3' on host 'localhost'
delete from mysql.user where user like 'mysqltest\_%';
......@@ -88,8 +88,8 @@ disconnect user2;
connection default;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT ALL PRIVILEGES ON `mysqltest\_1`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION
GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
GRANT ALL PRIVILEGES ON `mysqltest\_1`.* TO `mysqltest_1`@`localhost` WITH GRANT OPTION
delete from mysql.user where user like 'mysqltest\_%';
delete from mysql.db where user like 'mysqltest\_%';
drop database mysqltest_1;
......@@ -103,8 +103,8 @@ connect mrbad, localhost, mysqltest_1,,mysqltest;
connection mrbad;
show grants for current_user();
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT SELECT, INSERT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
GRANT SELECT, INSERT ON `mysqltest`.* TO `mysqltest_1`@`localhost`
insert into t1 values (1, 'I can''t change it!');
update t1 set data='I can change it!' where id = 1;
ERROR 42000: UPDATE command denied to user 'mysqltest_1'@'localhost' for table 't1'
......@@ -198,13 +198,13 @@ host db user table_name column_name
% test mysqltest_2 t2 c2
show grants for 'mysqltest_1';
Grants for mysqltest_1@%
GRANT USAGE ON *.* TO 'mysqltest_1'@'%'
GRANT USAGE ON *.* TO "mysqltest_1"@"%"
show grants for 'mysqltest_2';
Grants for mysqltest_2@%
GRANT SELECT ON *.* TO 'mysqltest_2'@'%' IDENTIFIED BY PASSWORD '*BD447CBA355AF58578D3AE33BA2E2CD388BA08D1'
GRANT INSERT ON "test".* TO 'mysqltest_2'@'%'
GRANT UPDATE (c2) ON "test"."t2" TO 'mysqltest_2'@'%'
GRANT UPDATE ON "test"."t1" TO 'mysqltest_2'@'%'
GRANT SELECT ON *.* TO "mysqltest_2"@"%" IDENTIFIED BY PASSWORD '*BD447CBA355AF58578D3AE33BA2E2CD388BA08D1'
GRANT INSERT ON "test".* TO "mysqltest_2"@"%"
GRANT UPDATE (c2) ON "test"."t2" TO "mysqltest_2"@"%"
GRANT UPDATE ON "test"."t1" TO "mysqltest_2"@"%"
drop user 'mysqltest_1';
select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password;
host user password
......@@ -239,10 +239,10 @@ host db user table_name column_name
% test mysqltest_1 t2 c2
show grants for 'mysqltest_1';
Grants for mysqltest_1@%
GRANT SELECT ON *.* TO 'mysqltest_1'@'%' IDENTIFIED BY PASSWORD '*BD447CBA355AF58578D3AE33BA2E2CD388BA08D1'
GRANT INSERT ON "test".* TO 'mysqltest_1'@'%'
GRANT UPDATE (c2) ON "test"."t2" TO 'mysqltest_1'@'%'
GRANT UPDATE ON "test"."t1" TO 'mysqltest_1'@'%'
GRANT SELECT ON *.* TO "mysqltest_1"@"%" IDENTIFIED BY PASSWORD '*BD447CBA355AF58578D3AE33BA2E2CD388BA08D1'
GRANT INSERT ON "test".* TO "mysqltest_1"@"%"
GRANT UPDATE (c2) ON "test"."t2" TO "mysqltest_1"@"%"
GRANT UPDATE ON "test"."t1" TO "mysqltest_1"@"%"
drop user 'mysqltest_1', 'mysqltest_3';
drop user 'mysqltest_1';
ERROR HY000: Operation DROP USER failed for 'mysqltest_1'@'%'
......@@ -292,19 +292,19 @@ drop user 'mysqltest_2';
create user '%@b'@'b';
show grants for '%@b'@'b';
Grants for %@b@b
GRANT USAGE ON *.* TO '%@b'@'b'
GRANT USAGE ON *.* TO "%@b"@"b"
grant select on mysql.* to '%@b'@'b';
show grants for '%@b'@'b';
Grants for %@b@b
GRANT USAGE ON *.* TO '%@b'@'b'
GRANT SELECT ON "mysql".* TO '%@b'@'b'
GRANT USAGE ON *.* TO "%@b"@"b"
GRANT SELECT ON "mysql".* TO "%@b"@"b"
rename user '%@b'@'b' to '%@a'@'a';
show grants for '%@b'@'b';
ERROR 42000: There is no such grant defined for user '%@b' on host 'b'
show grants for '%@a'@'a';
Grants for %@a@a
GRANT USAGE ON *.* TO '%@a'@'a'
GRANT SELECT ON "mysql".* TO '%@a'@'a'
GRANT USAGE ON *.* TO "%@a"@"a"
GRANT SELECT ON "mysql".* TO "%@a"@"a"
drop user '%@a'@'a';
create user mysqltest_2@localhost;
grant create user on *.* to mysqltest_2@localhost;
......@@ -324,8 +324,8 @@ connect user4,localhost,mysqltest_3,,;
connection user4;
show grants;
Grants for mysqltest_3@localhost
GRANT USAGE ON *.* TO 'mysqltest_3'@'localhost'
GRANT INSERT, UPDATE, DELETE ON `mysql`.* TO 'mysqltest_3'@'localhost'
GRANT USAGE ON *.* TO `mysqltest_3`@`localhost`
GRANT INSERT, UPDATE, DELETE ON `mysql`.* TO `mysqltest_3`@`localhost`
select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password;
ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for table 'user'
insert into mysql.user set host='%', user='mysqltest_B';
......@@ -350,8 +350,8 @@ connect n1,127.0.0.1,mysqltest_1,,mysqltest_1,$MASTER_MYPORT,$MASTER_MYSOCK;
connection n1;
show grants for current_user();
Grants for mysqltest_1@127.0.0.0/255.0.0.0
GRANT USAGE ON *.* TO 'mysqltest_1'@'127.0.0.0/255.0.0.0'
GRANT ALL PRIVILEGES ON `mysqltest_1`.`t1` TO 'mysqltest_1'@'127.0.0.0/255.0.0.0'
GRANT USAGE ON *.* TO `mysqltest_1`@`127.0.0.0/255.0.0.0`
GRANT ALL PRIVILEGES ON `mysqltest_1`.`t1` TO `mysqltest_1`@`127.0.0.0/255.0.0.0`
select * from t1;
i
1
......
......@@ -143,9 +143,9 @@ connect conn1,localhost,mysqltest1,,;
connection conn1;
SHOW GRANTS;
Grants for mysqltest1@%
GRANT USAGE ON *.* TO 'mysqltest1'@'%'
GRANT SELECT, UPDATE ON `mysqltest\_1`.* TO 'mysqltest1'@'%'
GRANT UPDATE ON `mysqltest_1`.* TO 'mysqltest1'@'%'
GRANT USAGE ON *.* TO `mysqltest1`@`%`
GRANT SELECT, UPDATE ON `mysqltest\_1`.* TO `mysqltest1`@`%`
GRANT UPDATE ON `mysqltest_1`.* TO `mysqltest1`@`%`
SELECT * FROM mysqltest_1.t1;
a
disconnect conn1;
......@@ -166,20 +166,20 @@ RENAME USER 'user1'@'%' TO 'user2'@'%';
# Show privileges after rename and BEFORE grant
SHOW GRANTS FOR 'user2'@'%';
Grants for user2@%
GRANT USAGE ON *.* TO 'user2'@'%'
GRANT USAGE ON *.* TO `user2`@`%`
GRANT SELECT (a), INSERT (b) ON `temp`.`t1` TO 'user2'@'%';
# Show privileges after rename and grant
SHOW GRANTS FOR 'user2'@'%';
Grants for user2@%
GRANT USAGE ON *.* TO 'user2'@'%'
GRANT SELECT (a), INSERT (b) ON `temp`.`t1` TO 'user2'@'%'
GRANT USAGE ON *.* TO `user2`@`%`
GRANT SELECT (a), INSERT (b) ON `temp`.`t1` TO `user2`@`%`
# Connect as the renamed user
connect conn1, localhost, user2,,;
connection conn1;
SHOW GRANTS;
Grants for user2@%
GRANT USAGE ON *.* TO 'user2'@'%'
GRANT SELECT (a), INSERT (b) ON `temp`.`t1` TO 'user2'@'%'
GRANT USAGE ON *.* TO `user2`@`%`
GRANT SELECT (a), INSERT (b) ON `temp`.`t1` TO `user2`@`%`
SELECT a FROM temp.t1;
a
1
......
......@@ -8,11 +8,11 @@ connect conn_1, localhost, test,,;
set role foo;
show grants for test;
Grants for test@%
GRANT foo TO 'test'@'%'
GRANT USAGE ON *.* TO 'test'@'%'
GRANT `foo` TO `test`@`%`
GRANT USAGE ON *.* TO `test`@`%`
show grants for foo;
Grants for foo
GRANT USAGE ON *.* TO 'foo'
GRANT USAGE ON *.* TO `foo`
show grants for foo@'%';
ERROR 42000: Access denied for user 'test'@'%' to database 'mysql'
connection default;
......@@ -25,3 +25,98 @@ ERROR HY000: Table 'user' was not locked with LOCK TABLES
REVOKE PROCESS ON *.* FROM u;
ERROR HY000: Table 'user' was not locked with LOCK TABLES
DROP TABLE t1;
#
# MDEV-20076: SHOW GRANTS does not quote role names properly
#
create role 'role1';
create role 'fetch';
create role 'role-1';
create role 'rock\'n\'roll';
create user 'user1'@'localhost';
create user 'fetch'@'localhost';
create user 'user-1'@'localhost';
create user 'O\'Brien'@'localhost';
grant select on mysql.user to role1;
grant select on mysql.user to 'fetch';
grant select on mysql.user to 'role-1';
grant select on mysql.user to 'rock\'n\'roll';
GRANT 'role1' TO 'user1'@'localhost';
GRANT 'fetch' TO 'fetch'@'localhost';
GRANT 'role-1' TO 'user-1'@'localhost';
GRANT 'rock\'n\'roll' TO 'O\'Brien'@'localhost';
show grants for 'role1';
Grants for role1
GRANT USAGE ON *.* TO `role1`
GRANT SELECT ON `mysql`.`user` TO `role1`
show grants for 'fetch';
Grants for fetch
GRANT USAGE ON *.* TO `fetch`
GRANT SELECT ON `mysql`.`user` TO `fetch`
show grants for 'role-1';
Grants for role-1
GRANT USAGE ON *.* TO `role-1`
GRANT SELECT ON `mysql`.`user` TO `role-1`
show grants for 'rock\'n\'roll';
Grants for rock'n'roll
GRANT USAGE ON *.* TO `rock'n'roll`
GRANT SELECT ON `mysql`.`user` TO `rock'n'roll`
show grants for 'user1'@'localhost';
Grants for user1@localhost
GRANT `role1` TO `user1`@`localhost`
GRANT USAGE ON *.* TO `user1`@`localhost`
show grants for 'fetch'@'localhost';
Grants for fetch@localhost
GRANT `fetch` TO `fetch`@`localhost`
GRANT USAGE ON *.* TO `fetch`@`localhost`
show grants for 'user-1'@'localhost';
Grants for user-1@localhost
GRANT `role-1` TO `user-1`@`localhost`
GRANT USAGE ON *.* TO `user-1`@`localhost`
show grants for 'O\'Brien'@'localhost';
Grants for O'Brien@localhost
GRANT `rock'n'roll` TO `O'Brien`@`localhost`
GRANT USAGE ON *.* TO `O'Brien`@`localhost`
set @save_sql_quote_show_create= @@sql_quote_show_create;
set @@sql_quote_show_create= OFF;
show grants for 'role1';
Grants for role1
GRANT USAGE ON *.* TO role1
GRANT SELECT ON `mysql`.`user` TO role1
show grants for 'fetch';
Grants for fetch
GRANT USAGE ON *.* TO `fetch`
GRANT SELECT ON `mysql`.`user` TO `fetch`
show grants for 'role-1';
Grants for role-1
GRANT USAGE ON *.* TO `role-1`
GRANT SELECT ON `mysql`.`user` TO `role-1`
show grants for 'rock\'n\'roll';
Grants for rock'n'roll
GRANT USAGE ON *.* TO `rock'n'roll`
GRANT SELECT ON `mysql`.`user` TO `rock'n'roll`
show grants for 'user1'@'localhost';
Grants for user1@localhost
GRANT role1 TO user1@localhost
GRANT USAGE ON *.* TO user1@localhost
show grants for 'fetch'@'localhost';
Grants for fetch@localhost
GRANT `fetch` TO `fetch`@localhost
GRANT USAGE ON *.* TO `fetch`@localhost
show grants for 'user-1'@'localhost';
Grants for user-1@localhost
GRANT `role-1` TO `user-1`@localhost
GRANT USAGE ON *.* TO `user-1`@localhost
show grants for 'O\'Brien'@'localhost';
Grants for O'Brien@localhost
GRANT `rock'n'roll` TO `O'Brien`@localhost
GRANT USAGE ON *.* TO `O'Brien`@localhost
set @@sql_quote_show_create= @save_sql_quote_show_create;
drop role 'role1';
drop role 'fetch';
drop role 'role-1';
drop role 'rock\'n\'roll';
drop user 'user1'@'localhost';
drop user 'fetch'@'localhost';
drop user 'user-1'@'localhost';
drop user 'O\'Brien'@'localhost';
# End of 10.3 tests
......@@ -33,3 +33,53 @@ REVOKE EXECUTE ON PROCEDURE sp FROM u;
--error ER_TABLE_NOT_LOCKED
REVOKE PROCESS ON *.* FROM u;
DROP TABLE t1;
--echo #
--echo # MDEV-20076: SHOW GRANTS does not quote role names properly
--echo #
create role 'role1';
create role 'fetch';
create role 'role-1';
create role 'rock\'n\'roll';
create user 'user1'@'localhost';
create user 'fetch'@'localhost';
create user 'user-1'@'localhost';
create user 'O\'Brien'@'localhost';
grant select on mysql.user to role1;
grant select on mysql.user to 'fetch';
grant select on mysql.user to 'role-1';
grant select on mysql.user to 'rock\'n\'roll';
GRANT 'role1' TO 'user1'@'localhost';
GRANT 'fetch' TO 'fetch'@'localhost';
GRANT 'role-1' TO 'user-1'@'localhost';
GRANT 'rock\'n\'roll' TO 'O\'Brien'@'localhost';
show grants for 'role1';
show grants for 'fetch';
show grants for 'role-1';
show grants for 'rock\'n\'roll';
show grants for 'user1'@'localhost';
show grants for 'fetch'@'localhost';
show grants for 'user-1'@'localhost';
show grants for 'O\'Brien'@'localhost';
set @save_sql_quote_show_create= @@sql_quote_show_create;
set @@sql_quote_show_create= OFF;
show grants for 'role1';
show grants for 'fetch';
show grants for 'role-1';
show grants for 'rock\'n\'roll';
show grants for 'user1'@'localhost';
show grants for 'fetch'@'localhost';
show grants for 'user-1'@'localhost';
show grants for 'O\'Brien'@'localhost';
set @@sql_quote_show_create= @save_sql_quote_show_create;
drop role 'role1';
drop role 'fetch';
drop role 'role-1';
drop role 'rock\'n\'roll';
drop user 'user1'@'localhost';
drop user 'fetch'@'localhost';
drop user 'user-1'@'localhost';
drop user 'O\'Brien'@'localhost';
--echo # End of 10.3 tests
......@@ -14,11 +14,11 @@ connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection root;
show grants for current_user;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
show grants;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
create database if not exists mysqltest;
create table mysqltest.t1 (a int,b int,c int);
......@@ -65,8 +65,8 @@ connect user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK;
connection user1;
show grants for current_user();
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
GRANT SELECT ON `mysqltest`.* TO `mysqltest_1`@`localhost`
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 6
......@@ -131,7 +131,7 @@ connect unkuser,localhost,unkuser,,,$MASTER_MYPORT,$MASTER_MYSOCK;
connection unkuser;
show grants for current_user();
Grants for @localhost
GRANT USAGE ON *.* TO ''@'localhost'
GRANT USAGE ON *.* TO ``@`localhost`
connect user2,localhost,mysqltest_2,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK;
connection user2;
select "user2";
......@@ -197,8 +197,8 @@ user4
user4
show grants;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
GRANT SELECT ON `mysqltest`.* TO `mysqltest_1`@`localhost`
select a from t1;
ERROR 3D000: No database selected
select * from mysqltest.t1,test.t1;
......
......@@ -14,11 +14,11 @@ connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection root;
show grants for current_user;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
show grants;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
create database if not exists mysqltest;
create table mysqltest.t1 (a int,b int,c int);
......@@ -65,8 +65,8 @@ connect user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK;
connection user1;
show grants for current_user();
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
GRANT SELECT ON `mysqltest`.* TO `mysqltest_1`@`localhost`
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 6
......@@ -131,7 +131,7 @@ connect unkuser,localhost,unkuser,,,$MASTER_MYPORT,$MASTER_MYSOCK;
connection unkuser;
show grants for current_user();
Grants for @localhost
GRANT USAGE ON *.* TO ''@'localhost'
GRANT USAGE ON *.* TO ``@`localhost`
connect user2,localhost,mysqltest_2,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK;
connection user2;
select "user2";
......@@ -197,8 +197,8 @@ user4
user4
show grants;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
GRANT SELECT ON `mysqltest`.* TO `mysqltest_1`@`localhost`
select a from t1;
ERROR 3D000: No database selected
select * from mysqltest.t1,test.t1;
......
......@@ -1039,8 +1039,8 @@ GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'user1'@'localhost' def USAGE NO
show grants;
Grants for user1@localhost
GRANT USAGE ON *.* TO 'user1'@'localhost'
GRANT SELECT (f1) ON `mysqltest`.`t1` TO 'user1'@'localhost'
GRANT USAGE ON *.* TO `user1`@`localhost`
GRANT SELECT (f1) ON `mysqltest`.`t1` TO `user1`@`localhost`
connection con2;
select * from information_schema.column_privileges order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
......@@ -1054,8 +1054,8 @@ GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'user2'@'localhost' def USAGE NO
show grants;
Grants for user2@localhost
GRANT USAGE ON *.* TO 'user2'@'localhost'
GRANT SELECT ON `mysqltest`.`t2` TO 'user2'@'localhost'
GRANT USAGE ON *.* TO `user2`@`localhost`
GRANT SELECT ON `mysqltest`.`t2` TO `user2`@`localhost`
connection con3;
select * from information_schema.column_privileges order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
......@@ -1069,8 +1069,8 @@ GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'user3'@'localhost' def USAGE NO
show grants;
Grants for user3@localhost
GRANT USAGE ON *.* TO 'user3'@'localhost'
GRANT SELECT ON `mysqltest`.* TO 'user3'@'localhost'
GRANT USAGE ON *.* TO `user3`@`localhost`
GRANT SELECT ON `mysqltest`.* TO `user3`@`localhost`
connection con4;
select * from information_schema.column_privileges where grantee like '\'user%'
order by grantee;
......@@ -1093,7 +1093,7 @@ GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'user4'@'localhost' def SELECT NO
show grants;
Grants for user4@localhost
GRANT SELECT ON *.* TO 'user4'@'localhost'
GRANT SELECT ON *.* TO `user4`@`localhost`
connection default;
disconnect con1;
disconnect con2;
......
......@@ -2,7 +2,7 @@ set @old_debug= @@debug_dbug;
create user user_1;
show grants for user_1;
Grants for user_1@%
GRANT USAGE ON *.* TO 'user_1'@'%'
GRANT USAGE ON *.* TO `user_1`@`%`
# create user
create database d;
use d;
......
create user user_1;
show grants for user_1;
Grants for user_1@%
GRANT USAGE ON *.* TO 'user_1'@'%'
GRANT USAGE ON *.* TO `user_1`@`%`
# create user
create database d;
use d;
......
......@@ -4,8 +4,8 @@ CREATE USER testuser@'::1' identified by '1234';
GRANT ALL ON test.* TO testuser@'::1';
SHOW GRANTS FOR testuser@'::1';
Grants for testuser@::1
GRANT USAGE ON *.* TO 'testuser'@'::1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'::1'
GRANT USAGE ON *.* TO `testuser`@`::1` IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO `testuser`@`::1`
SET @nip= inet_aton('::1');
SELECT @nip;
@nip
......@@ -36,8 +36,8 @@ CREATE USER testuser@'127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'127.0.0.1';
SHOW GRANTS FOR testuser@'127.0.0.1';
Grants for testuser@127.0.0.1
GRANT USAGE ON *.* TO 'testuser'@'127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'127.0.0.1'
GRANT USAGE ON *.* TO `testuser`@`127.0.0.1` IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO `testuser`@`127.0.0.1`
SET @nip= inet_aton('127.0.0.1');
SELECT @nip;
@nip
......
......@@ -4,8 +4,8 @@ CREATE USER testuser@'127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'127.0.0.1';
SHOW GRANTS FOR testuser@'127.0.0.1';
Grants for testuser@127.0.0.1
GRANT USAGE ON *.* TO 'testuser'@'127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'127.0.0.1'
GRANT USAGE ON *.* TO `testuser`@`127.0.0.1` IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO `testuser`@`127.0.0.1`
SET @nip= inet_aton('127.0.0.1');
SELECT @nip;
@nip
......@@ -36,8 +36,8 @@ CREATE USER testuser@'0:0:0:0:0:FFFF:127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'0:0:0:0:0:FFFF:127.0.0.1';
SHOW GRANTS FOR testuser@'0:0:0:0:0:FFFF:127.0.0.1';
Grants for testuser@0:0:0:0:0:ffff:127.0.0.1
GRANT USAGE ON *.* TO 'testuser'@'0:0:0:0:0:ffff:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0:0:0:0:ffff:127.0.0.1'
GRANT USAGE ON *.* TO `testuser`@`0:0:0:0:0:ffff:127.0.0.1` IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO `testuser`@`0:0:0:0:0:ffff:127.0.0.1`
SET @nip= inet_aton('0:0:0:0:0:FFFF:127.0.0.1');
SELECT @nip;
@nip
......@@ -68,8 +68,8 @@ CREATE USER testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' identified by '12
GRANT ALL ON test.* TO testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
SHOW GRANTS FOR testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
Grants for testuser@0000:0000:0000:0000:0000:ffff:127.0.0.1
GRANT USAGE ON *.* TO 'testuser'@'0000:0000:0000:0000:0000:ffff:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0000:0000:0000:0000:0000:ffff:127.0.0.1'
GRANT USAGE ON *.* TO `testuser`@`0000:0000:0000:0000:0000:ffff:127.0.0.1` IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO `testuser`@`0000:0000:0000:0000:0000:ffff:127.0.0.1`
SET @nip= inet_aton('0000:0000:0000:0000:0000:FFFF:127.0.0.1');
SELECT @nip;
@nip
......@@ -100,8 +100,8 @@ CREATE USER testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1';
SHOW GRANTS FOR testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1';
Grants for testuser@0:0000:0000:0:0000:ffff:127.0.0.1
GRANT USAGE ON *.* TO 'testuser'@'0:0000:0000:0:0000:ffff:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0000:0000:0:0000:ffff:127.0.0.1'
GRANT USAGE ON *.* TO `testuser`@`0:0000:0000:0:0000:ffff:127.0.0.1` IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO `testuser`@`0:0000:0000:0:0000:ffff:127.0.0.1`
SET @nip= inet_aton('0:0000:0000:0:0000:FFFF:127.0.0.1');
SELECT @nip;
@nip
......@@ -132,8 +132,8 @@ CREATE USER testuser@'0::0000:FFFF:127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'0::0000:FFFF:127.0.0.1';
SHOW GRANTS FOR testuser@'0::0000:FFFF:127.0.0.1';
Grants for testuser@0::0000:ffff:127.0.0.1
GRANT USAGE ON *.* TO 'testuser'@'0::0000:ffff:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0::0000:ffff:127.0.0.1'
GRANT USAGE ON *.* TO `testuser`@`0::0000:ffff:127.0.0.1` IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO `testuser`@`0::0000:ffff:127.0.0.1`
SET @nip= inet_aton('0::0000:FFFF:127.0.0.1');
SELECT @nip;
@nip
......@@ -165,8 +165,8 @@ CREATE USER testuser@'::FFFF:127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'::FFFF:127.0.0.1';
SHOW GRANTS FOR testuser@'::FFFF:127.0.0.1';
Grants for testuser@::ffff:127.0.0.1
GRANT USAGE ON *.* TO 'testuser'@'::ffff:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'::ffff:127.0.0.1'
GRANT USAGE ON *.* TO `testuser`@`::ffff:127.0.0.1` IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO `testuser`@`::ffff:127.0.0.1`
SET @nip= inet_aton('::FFFF:127.0.0.1');
SELECT @nip;
@nip
......
......@@ -4,8 +4,8 @@ CREATE USER testuser@'::1' identified by '1234';
GRANT ALL ON test.* TO testuser@'::1';
SHOW GRANTS FOR testuser@'::1';
Grants for testuser@::1
GRANT USAGE ON *.* TO 'testuser'@'::1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'::1'
GRANT USAGE ON *.* TO `testuser`@`::1` IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO `testuser`@`::1`
SET @nip= inet_aton('::1');
SELECT @nip;
@nip
......@@ -37,8 +37,8 @@ CREATE USER testuser@'0000:0000:0000:0000:0000:0000:0000:0001' identified by '12
GRANT ALL ON test.* TO testuser@'0000:0000:0000:0000:0000:0000:0000:0001';
SHOW GRANTS FOR testuser@'0000:0000:0000:0000:0000:0000:0000:0001';
Grants for testuser@0000:0000:0000:0000:0000:0000:0000:0001
GRANT USAGE ON *.* TO 'testuser'@'0000:0000:0000:0000:0000:0000:0000:0001' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0000:0000:0000:0000:0000:0000:0000:0001'
GRANT USAGE ON *.* TO `testuser`@`0000:0000:0000:0000:0000:0000:0000:0001` IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO `testuser`@`0000:0000:0000:0000:0000:0000:0000:0001`
SET @nip= inet_aton('0000:0000:0000:0000:0000:0000:0000:0001');
SELECT @nip;
@nip
......@@ -69,8 +69,8 @@ CREATE USER testuser@'0:0:0:0:0:0:0:1' identified by '1234';
GRANT ALL ON test.* TO testuser@'0:0:0:0:0:0:0:1';
SHOW GRANTS FOR testuser@'0:0:0:0:0:0:0:1';
Grants for testuser@0:0:0:0:0:0:0:1
GRANT USAGE ON *.* TO 'testuser'@'0:0:0:0:0:0:0:1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0:0:0:0:0:0:1'
GRANT USAGE ON *.* TO `testuser`@`0:0:0:0:0:0:0:1` IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO `testuser`@`0:0:0:0:0:0:0:1`
SET @nip= inet_aton('0:0:0:0:0:0:0:1');
SELECT @nip;
@nip
......
......@@ -4,8 +4,8 @@ create database MYSQLtest;
grant all on MySQLtest.* to mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
GRANT ALL PRIVILEGES ON `mysqltest`.* TO `mysqltest_1`@`localhost`
select * from db where user = 'mysqltest_1';
Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Execute_priv Event_priv Trigger_priv Delete_history_priv
localhost mysqltest mysqltest_1 Y Y Y Y Y Y N Y Y Y Y Y Y Y Y Y Y Y Y Y
......@@ -13,8 +13,8 @@ update db set db = 'MYSQLtest' where db = 'mysqltest' and user = 'mysqltest_1' a
flush privileges;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
GRANT ALL PRIVILEGES ON `mysqltest`.* TO `mysqltest_1`@`localhost`
select * from db where user = 'mysqltest_1';
Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Execute_priv Event_priv Trigger_priv Delete_history_priv
localhost MYSQLtest mysqltest_1 Y Y Y Y Y Y N Y Y Y Y Y Y Y Y Y Y Y Y Y
......
......@@ -313,8 +313,8 @@ Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
SHOW GRANTS FOR 'user3'@'%';
Grants for user3@%
GRANT USAGE ON *.* TO 'user3'@'%'
GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%'
GRANT USAGE ON *.* TO `user3`@`%`
GRANT ALL PRIVILEGES ON `roelt`.`test2` TO `user3`@`%`
DROP USER 'user3'@'%';
End of 5.1 tests
The --upgrade-system-tables option was used, user tables won't be touched.
......@@ -586,7 +586,7 @@ Run mysql_upgrade with all privileges on a user
flush privileges;
SHOW GRANTS FOR 'user3'@'%';
Grants for user3@%
GRANT USAGE ON *.* TO 'user3'@'%'
GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%'
GRANT USAGE ON *.* TO `user3`@`%`
GRANT ALL PRIVILEGES ON `roelt`.`test2` TO `user3`@`%`
DROP USER 'user3'@'%';
update mysql.db set Delete_history_priv='Y' where db like 'test%';
......@@ -654,8 +654,8 @@ CREATE USER untrusted@localhost;
GRANT SELECT ON mysqltest1.* TO untrusted@localhost;
SHOW GRANTS FOR untrusted@localhost;
Grants for untrusted@localhost
GRANT USAGE ON *.* TO 'untrusted'@'localhost'
GRANT SELECT ON `mysqltest1`.* TO 'untrusted'@'localhost'
GRANT USAGE ON *.* TO `untrusted`@`localhost`
GRANT SELECT ON `mysqltest1`.* TO `untrusted`@`localhost`
USE mysqltest1;
CREATE TABLE t1 (a INT, b CHAR(64));
flush logs;
......
......@@ -76,13 +76,13 @@ create user ioo identified with "mysql_old_password" as "7a8f886d28473e85";
#
show grants for foo;
Grants for foo@%
GRANT USAGE ON *.* TO 'foo'@'%'
GRANT USAGE ON *.* TO `foo`@`%`
show grants for goo;
Grants for goo@%
GRANT USAGE ON *.* TO 'goo'@'%' IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
GRANT USAGE ON *.* TO `goo`@`%` IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
show grants for ioo;
Grants for ioo@%
GRANT USAGE ON *.* TO 'ioo'@'%' IDENTIFIED BY PASSWORD '7a8f886d28473e85'
GRANT USAGE ON *.* TO `ioo`@`%` IDENTIFIED BY PASSWORD '7a8f886d28473e85'
select user, host, select_priv, plugin, authentication_string from mysql.user
where user like "%oo"
order by user;
......@@ -96,13 +96,13 @@ ioo % N mysql_old_password 7a8f886d28473e85
SET PASSWORD FOR foo=PASSWORD("bar");
show grants for foo;
Grants for foo@%
GRANT USAGE ON *.* TO 'foo'@'%' IDENTIFIED BY PASSWORD '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB'
GRANT USAGE ON *.* TO `foo`@`%` IDENTIFIED BY PASSWORD '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB'
show grants for goo;
Grants for goo@%
GRANT USAGE ON *.* TO 'goo'@'%' IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
GRANT USAGE ON *.* TO `goo`@`%` IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
show grants for ioo;
Grants for ioo@%
GRANT USAGE ON *.* TO 'ioo'@'%' IDENTIFIED BY PASSWORD '7a8f886d28473e85'
GRANT USAGE ON *.* TO `ioo`@`%` IDENTIFIED BY PASSWORD '7a8f886d28473e85'
select user, host, select_priv, plugin, authentication_string from mysql.user
where user like "%oo"
order by user;
......@@ -116,13 +116,13 @@ ioo % N mysql_old_password 7a8f886d28473e85
flush privileges;
show grants for foo;
Grants for foo@%
GRANT USAGE ON *.* TO 'foo'@'%' IDENTIFIED BY PASSWORD '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB'
GRANT USAGE ON *.* TO `foo`@`%` IDENTIFIED BY PASSWORD '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB'
show grants for goo;
Grants for goo@%
GRANT USAGE ON *.* TO 'goo'@'%' IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
GRANT USAGE ON *.* TO `goo`@`%` IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
show grants for ioo;
Grants for ioo@%
GRANT USAGE ON *.* TO 'ioo'@'%' IDENTIFIED BY PASSWORD '7a8f886d28473e85'
GRANT USAGE ON *.* TO `ioo`@`%` IDENTIFIED BY PASSWORD '7a8f886d28473e85'
#
# Test granting of privileges.
#
......@@ -131,26 +131,26 @@ grant select on *.* to goo;
grant select on *.* to ioo;
show grants for foo;
Grants for foo@%
GRANT SELECT ON *.* TO 'foo'@'%' IDENTIFIED BY PASSWORD '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB'
GRANT SELECT ON *.* TO `foo`@`%` IDENTIFIED BY PASSWORD '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB'
show grants for goo;
Grants for goo@%
GRANT SELECT ON *.* TO 'goo'@'%' IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
GRANT SELECT ON *.* TO `goo`@`%` IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
show grants for ioo;
Grants for ioo@%
GRANT SELECT ON *.* TO 'ioo'@'%' IDENTIFIED BY PASSWORD '7a8f886d28473e85'
GRANT SELECT ON *.* TO `ioo`@`%` IDENTIFIED BY PASSWORD '7a8f886d28473e85'
#
# Check to see if grants are stable on flush.
#
flush privileges;
show grants for foo;
Grants for foo@%
GRANT SELECT ON *.* TO 'foo'@'%' IDENTIFIED BY PASSWORD '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB'
GRANT SELECT ON *.* TO `foo`@`%` IDENTIFIED BY PASSWORD '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB'
show grants for goo;
Grants for goo@%
GRANT SELECT ON *.* TO 'goo'@'%' IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
GRANT SELECT ON *.* TO `goo`@`%` IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
show grants for ioo;
Grants for ioo@%
GRANT SELECT ON *.* TO 'ioo'@'%' IDENTIFIED BY PASSWORD '7a8f886d28473e85'
GRANT SELECT ON *.* TO `ioo`@`%` IDENTIFIED BY PASSWORD '7a8f886d28473e85'
#
# Check internal table representation.
#
......
......@@ -10,8 +10,8 @@ grant select,alter on mysqltest_1.* to mysqltest_1@localhost;
connect conn1,localhost,mysqltest_1,,mysqltest_1;
show grants for current_user;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT SELECT, ALTER ON `mysqltest_1`.* TO 'mysqltest_1'@'localhost'
GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
GRANT SELECT, ALTER ON `mysqltest_1`.* TO `mysqltest_1`@`localhost`
alter table t1 add b int;
alter table t1 drop partition p2;
ERROR 42000: DROP command denied to user 'mysqltest_1'@'localhost' for table 't1'
......
......@@ -185,18 +185,18 @@ in default connection
disconnect proxy_admin_con;
SHOW GRANTS FOR grant_plug;
Grants for grant_plug@%
GRANT ALL PRIVILEGES ON *.* TO 'grant_plug'@'%' IDENTIFIED VIA test_plugin_server USING 'grant_plug_dest'
GRANT ALL PRIVILEGES ON *.* TO `grant_plug`@`%` IDENTIFIED VIA test_plugin_server USING 'grant_plug_dest'
GRANT PROXY ON 'future_user'@'%' TO 'grant_plug'@'%'
REVOKE PROXY ON future_user FROM grant_plug;
SHOW GRANTS FOR grant_plug;
Grants for grant_plug@%
GRANT ALL PRIVILEGES ON *.* TO 'grant_plug'@'%' IDENTIFIED VIA test_plugin_server USING 'grant_plug_dest'
GRANT ALL PRIVILEGES ON *.* TO `grant_plug`@`%` IDENTIFIED VIA test_plugin_server USING 'grant_plug_dest'
## testing drop user
CREATE USER test_drop@localhost;
GRANT PROXY ON future_user TO test_drop@localhost;
SHOW GRANTS FOR test_drop@localhost;
Grants for test_drop@localhost
GRANT USAGE ON *.* TO 'test_drop'@'localhost'
GRANT USAGE ON *.* TO `test_drop`@`localhost`
GRANT PROXY ON 'future_user'@'%' TO 'test_drop'@'localhost'
DROP USER test_drop@localhost;
SELECT * FROM mysql.proxies_priv WHERE Host = 'test_drop' AND User = 'localhost';
......
......@@ -11,8 +11,8 @@ grant select on mysqltest.t9 to second_user@localhost
identified by 'looser' ;
show grants for second_user@localhost ;
Grants for second_user@localhost
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
GRANT SELECT ON `mysqltest`.`t9` TO `second_user`@`localhost`
connect con3,localhost,second_user,looser,mysqltest;
connection con3;
select current_user();
......@@ -20,8 +20,8 @@ current_user()
second_user@localhost
show grants for current_user();
Grants for second_user@localhost
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
GRANT SELECT ON `mysqltest`.`t9` TO `second_user`@`localhost`
prepare s_t9 from 'select c1 as my_col
from t9 where c1= 1' ;
execute s_t9 ;
......@@ -34,21 +34,21 @@ grant select on mysqltest.t1 to second_user@localhost
identified by 'looser' ;
show grants for second_user@localhost ;
Grants for second_user@localhost
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost'
GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
GRANT SELECT ON `mysqltest`.`t9` TO `second_user`@`localhost`
GRANT SELECT ON `mysqltest`.`t1` TO `second_user`@`localhost`
drop table mysqltest.t9 ;
show grants for second_user@localhost ;
Grants for second_user@localhost
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost'
GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
GRANT SELECT ON `mysqltest`.`t9` TO `second_user`@`localhost`
GRANT SELECT ON `mysqltest`.`t1` TO `second_user`@`localhost`
connection con3;
show grants for second_user@localhost ;
Grants for second_user@localhost
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost'
GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
GRANT SELECT ON `mysqltest`.`t9` TO `second_user`@`localhost`
GRANT SELECT ON `mysqltest`.`t1` TO `second_user`@`localhost`
prepare s_t1 from 'select a as my_col from t1' ;
execute s_t1 ;
my_col
......@@ -63,13 +63,13 @@ connection default;
revoke all privileges on mysqltest.t1 from second_user@localhost;
show grants for second_user@localhost ;
Grants for second_user@localhost
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
GRANT SELECT ON `mysqltest`.`t9` TO `second_user`@`localhost`
connection con3;
show grants for second_user@localhost ;
Grants for second_user@localhost
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
GRANT SELECT ON `mysqltest`.`t9` TO `second_user`@`localhost`
execute s_t1 ;
ERROR 42000: SELECT command denied to user 'second_user'@'localhost' for table 't1'
connection default;
......@@ -77,7 +77,7 @@ disconnect con3;
revoke all privileges, grant option from second_user@localhost ;
show grants for second_user@localhost ;
Grants for second_user@localhost
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
drop user second_user@localhost ;
commit ;
show grants for second_user@localhost ;
......
......@@ -168,7 +168,7 @@ user() current_user()
foo@localhost foo@localhost
show grants;
Grants for foo@localhost
GRANT USAGE ON *.* TO 'foo'@'localhost' IDENTIFIED BY PASSWORD '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB'
GRANT USAGE ON *.* TO `foo`@`localhost` IDENTIFIED BY PASSWORD '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB'
disconnect foo;
connection default;
select user,host,password,plugin,authentication_string from mysql.user where user='foo';
......
create user foo;
show create user foo;
CREATE USER for foo@%
CREATE USER 'foo'@'%'
CREATE USER `foo`@`%`
create user foo@test;
show create user foo@test;
CREATE USER for foo@test
CREATE USER 'foo'@'test'
CREATE USER `foo`@`test`
create user foo2@test identified by 'password';
show create user foo2@test;
CREATE USER for foo2@test
CREATE USER 'foo2'@'test' IDENTIFIED BY PASSWORD '*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19'
CREATE USER `foo2`@`test` IDENTIFIED BY PASSWORD '*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19'
alter user foo2@test identified with 'someplugin' as 'somepassword';
show create user foo2@test;
CREATE USER for foo2@test
CREATE USER 'foo2'@'test' IDENTIFIED VIA someplugin USING 'somepassword'
CREATE USER `foo2`@`test` IDENTIFIED VIA someplugin USING 'somepassword'
create user foo3@test require SSL;
show create user foo3@test;
CREATE USER for foo3@test
CREATE USER 'foo3'@'test' REQUIRE SSL
CREATE USER `foo3`@`test` REQUIRE SSL
create user foo4@test require cipher 'text' issuer 'foo_issuer' subject 'foo_subject';
show create user foo4@test;
CREATE USER for foo4@test
CREATE USER 'foo4'@'test' REQUIRE ISSUER 'foo_issuer' SUBJECT 'foo_subject' CIPHER 'text'
CREATE USER `foo4`@`test` REQUIRE ISSUER 'foo_issuer' SUBJECT 'foo_subject' CIPHER 'text'
create user foo5@test require SSL
with MAX_QUERIES_PER_HOUR 10
MAX_UPDATES_PER_HOUR 20
......@@ -30,7 +30,7 @@ MAX_USER_CONNECTIONS 40
MAX_STATEMENT_TIME 0.5;
show create user foo5@test;
CREATE USER for foo5@test
CREATE USER 'foo5'@'test' REQUIRE SSL WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30 MAX_USER_CONNECTIONS 40 MAX_STATEMENT_TIME 0.500000
CREATE USER `foo5`@`test` REQUIRE SSL WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30 MAX_USER_CONNECTIONS 40 MAX_STATEMENT_TIME 0.500000
drop user foo5@test;
drop user foo4@test;
drop user foo3@test;
......
......@@ -13,16 +13,16 @@ u1 %
#
show grants for u1;
Grants for u1@%
GRANT USAGE ON *.* TO 'u1'@'%'
GRANT SELECT ON `mysql`.* TO 'u1'@'%'
GRANT USAGE ON *.* TO `u1`@`%`
GRANT SELECT ON `mysql`.* TO `u1`@`%`
#
# Test to see if connecting with no password is succesful.
#
connect con1, localhost, u1,,;
show grants;
Grants for u1@%
GRANT USAGE ON *.* TO 'u1'@'%'
GRANT SELECT ON `mysql`.* TO 'u1'@'%'
GRANT USAGE ON *.* TO `u1`@`%`
GRANT SELECT ON `mysql`.* TO `u1`@`%`
disconnect con1;
connection default;
#
......@@ -32,8 +32,8 @@ flush privileges;
connect con1, localhost, u1,,;
show grants;
Grants for u1@%
GRANT USAGE ON *.* TO 'u1'@'%'
GRANT SELECT ON `mysql`.* TO 'u1'@'%'
GRANT USAGE ON *.* TO `u1`@`%`
GRANT SELECT ON `mysql`.* TO `u1`@`%`
disconnect con1;
connection default;
#
......@@ -50,8 +50,8 @@ u1 % *7AFEFD08B6B720E781FB000CAA418F54FA662626
connect con1, localhost, u1,'SOMETHING',;
show grants;
Grants for u1@%
GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*7AFEFD08B6B720E781FB000CAA418F54FA662626'
GRANT SELECT ON `mysql`.* TO 'u1'@'%'
GRANT USAGE ON *.* TO `u1`@`%` IDENTIFIED BY PASSWORD '*7AFEFD08B6B720E781FB000CAA418F54FA662626'
GRANT SELECT ON `mysql`.* TO `u1`@`%`
disconnect con1;
connection default;
#
......@@ -61,8 +61,8 @@ flush privileges;
connect con1, localhost, u1,'SOMETHING',;
show grants;
Grants for u1@%
GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*7AFEFD08B6B720E781FB000CAA418F54FA662626'
GRANT SELECT ON `mysql`.* TO 'u1'@'%'
GRANT USAGE ON *.* TO `u1`@`%` IDENTIFIED BY PASSWORD '*7AFEFD08B6B720E781FB000CAA418F54FA662626'
GRANT SELECT ON `mysql`.* TO `u1`@`%`
disconnect con1;
connection default;
#
......@@ -78,16 +78,16 @@ u1 % *054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6 mysql_native_password *054B7BBD2B
#
show grants for u1;
Grants for u1@%
GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6'
GRANT SELECT ON `mysql`.* TO 'u1'@'%'
GRANT USAGE ON *.* TO `u1`@`%` IDENTIFIED BY PASSWORD '*054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6'
GRANT SELECT ON `mysql`.* TO `u1`@`%`
#
# Logging in with the user's password should work.
#
connect con1, localhost, u1,'SOMETHINGELSE',;
show grants;
Grants for u1@%
GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6'
GRANT SELECT ON `mysql`.* TO 'u1'@'%'
GRANT USAGE ON *.* TO `u1`@`%` IDENTIFIED BY PASSWORD '*054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6'
GRANT SELECT ON `mysql`.* TO `u1`@`%`
disconnect con1;
connection default;
#
......@@ -96,16 +96,16 @@ connection default;
flush privileges;
show grants for u1;
Grants for u1@%
GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6'
GRANT SELECT ON `mysql`.* TO 'u1'@'%'
GRANT USAGE ON *.* TO `u1`@`%` IDENTIFIED BY PASSWORD '*054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6'
GRANT SELECT ON `mysql`.* TO `u1`@`%`
#
# Here we connect via the user's password again.
#
connect con1, localhost, u1,'SOMETHINGELSE',;
show grants;
Grants for u1@%
GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6'
GRANT SELECT ON `mysql`.* TO 'u1'@'%'
GRANT USAGE ON *.* TO `u1`@`%` IDENTIFIED BY PASSWORD '*054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6'
GRANT SELECT ON `mysql`.* TO `u1`@`%`
disconnect con1;
connection default;
#
......@@ -119,8 +119,8 @@ u1 % *054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6
flush privileges;
show grants for u1;
Grants for u1@%
GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6'
GRANT SELECT ON `mysql`.* TO 'u1'@'%'
GRANT USAGE ON *.* TO `u1`@`%` IDENTIFIED BY PASSWORD '*054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6'
GRANT SELECT ON `mysql`.* TO `u1`@`%`
#
# Here we connect via the user's password.
#
......@@ -143,16 +143,16 @@ GRANT SELECT ON mysql.* to u1 IDENTIFIED VIA mysql_native_password
USING '*7AFEFD08B6B720E781FB000CAA418F54FA662626';
show grants for u1;
Grants for u1@%
GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*7AFEFD08B6B720E781FB000CAA418F54FA662626'
GRANT SELECT ON `mysql`.* TO 'u1'@'%'
GRANT USAGE ON *.* TO `u1`@`%` IDENTIFIED BY PASSWORD '*7AFEFD08B6B720E781FB000CAA418F54FA662626'
GRANT SELECT ON `mysql`.* TO `u1`@`%`
#
# Test if the user can now use that password instead.
#
connect con1, localhost, u1,'SOMETHING',;
show grants;
Grants for u1@%
GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*7AFEFD08B6B720E781FB000CAA418F54FA662626'
GRANT SELECT ON `mysql`.* TO 'u1'@'%'
GRANT USAGE ON *.* TO `u1`@`%` IDENTIFIED BY PASSWORD '*7AFEFD08B6B720E781FB000CAA418F54FA662626'
GRANT SELECT ON `mysql`.* TO `u1`@`%`
disconnect con1;
#
# Test if the user can now use that password instead, after flushing privileges;
......@@ -162,8 +162,8 @@ flush privileges;
connect con1, localhost, u1,'SOMETHING',;
show grants;
Grants for u1@%
GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*7AFEFD08B6B720E781FB000CAA418F54FA662626'
GRANT SELECT ON `mysql`.* TO 'u1'@'%'
GRANT USAGE ON *.* TO `u1`@`%` IDENTIFIED BY PASSWORD '*7AFEFD08B6B720E781FB000CAA418F54FA662626'
GRANT SELECT ON `mysql`.* TO `u1`@`%`
disconnect con1;
connection default;
#
......@@ -179,8 +179,8 @@ u1 % mysql_native_password
connect con1, localhost, u1,,;
show grants;
Grants for u1@%
GRANT USAGE ON *.* TO 'u1'@'%'
GRANT SELECT ON `mysql`.* TO 'u1'@'%'
GRANT USAGE ON *.* TO `u1`@`%`
GRANT SELECT ON `mysql`.* TO `u1`@`%`
disconnect con1;
connection default;
#
......@@ -190,8 +190,8 @@ flush privileges;
connect con1, localhost, u1,,;
show grants;
Grants for u1@%
GRANT USAGE ON *.* TO 'u1'@'%'
GRANT SELECT ON `mysql`.* TO 'u1'@'%'
GRANT USAGE ON *.* TO `u1`@`%`
GRANT SELECT ON `mysql`.* TO `u1`@`%`
disconnect con1;
connection default;
drop user u1;
......@@ -2,8 +2,8 @@ CREATE USER mysqltest_1@'127.0.0.1/255.255.255.255';
GRANT ALL ON test.* TO mysqltest_1@'127.0.0.1/255.255.255.255';
SHOW GRANTS FOR mysqltest_1@'127.0.0.1/255.255.255.255';
Grants for mysqltest_1@127.0.0.1/255.255.255.255
GRANT USAGE ON *.* TO 'mysqltest_1'@'127.0.0.1/255.255.255.255'
GRANT ALL PRIVILEGES ON `test`.* TO 'mysqltest_1'@'127.0.0.1/255.255.255.255'
GRANT USAGE ON *.* TO `mysqltest_1`@`127.0.0.1/255.255.255.255`
GRANT ALL PRIVILEGES ON `test`.* TO `mysqltest_1`@`127.0.0.1/255.255.255.255`
REVOKE ALL ON test.* FROM mysqltest_1@'127.0.0.1/255.255.255.255';
DROP USER mysqltest_1@'127.0.0.1/255.255.255.255';
connect con1, localhost, root, , test, $MASTER_MYPORT, ;
......
......@@ -195,14 +195,14 @@ grant insert on t1 to usera@localhost;
grant execute on procedure sptest.p1 to usera@localhost;
show grants for usera@localhost;
Grants for usera@localhost
GRANT USAGE ON *.* TO 'usera'@'localhost'
GRANT INSERT ON `test`.`t1` TO 'usera'@'localhost'
GRANT EXECUTE ON PROCEDURE `sptest`.`p1` TO 'usera'@'localhost'
GRANT USAGE ON *.* TO `usera`@`localhost`
GRANT INSERT ON `test`.`t1` TO `usera`@`localhost`
GRANT EXECUTE ON PROCEDURE `sptest`.`p1` TO `usera`@`localhost`
grant execute on procedure sptest.p1 to userc@localhost with grant option;
show grants for userc@localhost;
Grants for userc@localhost
GRANT USAGE ON *.* TO 'userc'@'localhost'
GRANT EXECUTE ON PROCEDURE `sptest`.`p1` TO 'userc'@'localhost' WITH GRANT OPTION
GRANT USAGE ON *.* TO `userc`@`localhost`
GRANT EXECUTE ON PROCEDURE `sptest`.`p1` TO `userc`@`localhost` WITH GRANT OPTION
connect con2usera,localhost,usera,,;
connect con3userb,localhost,userb,,;
connect con4userc,localhost,userc,,;
......@@ -239,18 +239,18 @@ userb@localhost 4
grant all privileges on procedure sptest.p1 to userc@localhost;
show grants for userc@localhost;
Grants for userc@localhost
GRANT USAGE ON *.* TO 'userc'@'localhost'
GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `sptest`.`p1` TO 'userc'@'localhost' WITH GRANT OPTION
GRANT USAGE ON *.* TO `userc`@`localhost`
GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `sptest`.`p1` TO `userc`@`localhost` WITH GRANT OPTION
show grants for userb@localhost;
Grants for userb@localhost
GRANT USAGE ON *.* TO 'userb'@'localhost'
GRANT EXECUTE ON PROCEDURE `sptest`.`p1` TO 'userb'@'localhost'
GRANT USAGE ON *.* TO `userb`@`localhost`
GRANT EXECUTE ON PROCEDURE `sptest`.`p1` TO `userb`@`localhost`
connection con4userc;
revoke all privileges on procedure sptest.p1 from userb@localhost;
connection con1root;
show grants for userb@localhost;
Grants for userb@localhost
GRANT USAGE ON *.* TO 'userb'@'localhost'
GRANT USAGE ON *.* TO `userb`@`localhost`
disconnect con4userc;
disconnect con3userb;
disconnect con2usera;
......@@ -723,14 +723,14 @@ user() current_user()
foo@localhost foo@local_ost
show grants;
Grants for foo@local_ost
GRANT USAGE ON *.* TO 'foo'@'local_ost'
GRANT CREATE ROUTINE ON `foodb`.* TO 'foo'@'local_ost'
GRANT USAGE ON *.* TO `foo`@`local_ost`
GRANT CREATE ROUTINE ON `foodb`.* TO `foo`@`local_ost`
create procedure fooproc() select 'i am fooproc';
show grants;
Grants for foo@local_ost
GRANT USAGE ON *.* TO 'foo'@'local_ost'
GRANT CREATE ROUTINE ON `foodb`.* TO 'foo'@'local_ost'
GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `test`.`fooproc` TO 'foo'@'local_ost'
GRANT USAGE ON *.* TO `foo`@`local_ost`
GRANT CREATE ROUTINE ON `foodb`.* TO `foo`@`local_ost`
GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `test`.`fooproc` TO `foo`@`local_ost`
disconnect con1;
connection default;
drop user foo@local_ost;
......@@ -772,13 +772,13 @@ set password=password('foobar');
create procedure sp1() select 1;
show grants;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*9B500343BC52E2911172EB52AE5CF4847604C6E5' WITH GRANT OPTION
GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` IDENTIFIED BY PASSWORD '*9B500343BC52E2911172EB52AE5CF4847604C6E5' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
grant execute on procedure sp1 to current_user() identified by 'barfoo';
show grants;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*343915A8181B5728EADBDC73E1F7E6B0C3998483' WITH GRANT OPTION
GRANT EXECUTE ON PROCEDURE `test`.`sp1` TO 'root'@'localhost'
GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` IDENTIFIED BY PASSWORD '*343915A8181B5728EADBDC73E1F7E6B0C3998483' WITH GRANT OPTION
GRANT EXECUTE ON PROCEDURE `test`.`sp1` TO `root`@`localhost`
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
drop procedure sp1;
set password='';
......
......@@ -8,11 +8,11 @@ show grants for 'root'@'localhost';
end|
call bug4902()|
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
call bug4902()|
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
drop procedure bug4902|
drop procedure if exists bug4902_2|
......@@ -159,11 +159,11 @@ create procedure 15298_2 () sql security definer show grants;
connect con1,localhost,mysqltest_1,,test;
call 15298_1();
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
call 15298_2();
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
connection default;
disconnect con1;
......@@ -330,21 +330,21 @@ update mysql.user set password = replace(password, '*', '-') where user='foo1';
connect foo,localhost,foo1,foo;
show grants;
Grants for foo1@localhost
GRANT USAGE ON *.* TO 'foo1'@'localhost' IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
GRANT CREATE ROUTINE ON `test`.* TO 'foo1'@'localhost'
GRANT USAGE ON *.* TO `foo1`@`localhost` IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
GRANT CREATE ROUTINE ON `test`.* TO `foo1`@`localhost`
connection default;
flush privileges;
connection foo;
show grants;
Grants for foo1@localhost
GRANT USAGE ON *.* TO 'foo1'@'localhost' IDENTIFIED BY PASSWORD '-F3A2A51A9B0F2BE2468926B4132313728C250DBF'
GRANT CREATE ROUTINE ON `test`.* TO 'foo1'@'localhost'
GRANT USAGE ON *.* TO `foo1`@`localhost` IDENTIFIED BY PASSWORD '-F3A2A51A9B0F2BE2468926B4132313728C250DBF'
GRANT CREATE ROUTINE ON `test`.* TO `foo1`@`localhost`
create procedure spfoo() select 1;
show grants;
Grants for foo1@localhost
GRANT USAGE ON *.* TO 'foo1'@'localhost' IDENTIFIED BY PASSWORD '-F3A2A51A9B0F2BE2468926B4132313728C250DBF'
GRANT CREATE ROUTINE ON `test`.* TO 'foo1'@'localhost'
GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `test`.`spfoo` TO 'foo1'@'localhost'
GRANT USAGE ON *.* TO `foo1`@`localhost` IDENTIFIED BY PASSWORD '-F3A2A51A9B0F2BE2468926B4132313728C250DBF'
GRANT CREATE ROUTINE ON `test`.* TO `foo1`@`localhost`
GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `test`.`spfoo` TO `foo1`@`localhost`
connection default;
disconnect foo;
drop procedure spfoo;
......
......@@ -13,8 +13,8 @@ connect tzuser, localhost, mysqltest_1,,;
connection tzuser;
show grants for current_user();
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.* TO 'mysqltest_1'@'localhost'
GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
GRANT ALL PRIVILEGES ON `test`.* TO `mysqltest_1`@`localhost`
set time_zone= '+00:00';
set time_zone= 'Europe/Moscow';
select convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC');
......@@ -39,9 +39,9 @@ connect tzuser2, localhost, mysqltest_1,,;
connection tzuser2;
show grants for current_user();
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.`t2` TO 'mysqltest_1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.`t1` TO 'mysqltest_1'@'localhost'
GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
GRANT ALL PRIVILEGES ON `test`.`t2` TO `mysqltest_1`@`localhost`
GRANT ALL PRIVILEGES ON `test`.`t1` TO `mysqltest_1`@`localhost`
set time_zone= '+00:00';
set time_zone= 'Europe/Moscow';
select convert_tz('2004-11-31 12:00:00', 'Europe/Moscow', 'UTC');
......
......@@ -194,8 +194,8 @@ use mysqltest_db1;
GRANT DELETE ON mysqltest_db1.* TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
GRANT DELETE, TRIGGER ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
GRANT DELETE, TRIGGER ON `mysqltest_db1`.* TO `mysqltest_u1`@`localhost`
connection bug15166_u1_con;
use mysqltest_db1;
CREATE TRIGGER t1_trg_after_delete AFTER DELETE ON t1
......
......@@ -108,11 +108,11 @@ connection default;
grant usage on *.* to mysqltest_1@localhost with max_user_connections -1;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_USER_CONNECTIONS -1
GRANT USAGE ON *.* TO `mysqltest_1`@`localhost` WITH MAX_USER_CONNECTIONS -1
flush user_resources;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_USER_CONNECTIONS -1
GRANT USAGE ON *.* TO `mysqltest_1`@`localhost` WITH MAX_USER_CONNECTIONS -1
connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
connect muc5, localhost, mysqltest_1,,;
ERROR 42000: User 'mysqltest_1' has exceeded the 'max_user_connections' resource (current value: -1)
......
......@@ -4,12 +4,12 @@ create user test@localhost;
grant create view on test.* to test@localhost;
show grants for test@localhost;
Grants for test@localhost
GRANT USAGE ON *.* TO 'test'@'localhost'
GRANT CREATE VIEW ON `test`.* TO 'test'@'localhost'
GRANT USAGE ON *.* TO `test`@`localhost`
GRANT CREATE VIEW ON `test`.* TO `test`@`localhost`
revoke create view on test.* from test@localhost;
show grants for test@localhost;
Grants for test@localhost
GRANT USAGE ON *.* TO 'test'@'localhost'
GRANT USAGE ON *.* TO `test`@`localhost`
drop user test@localhost;
connect root,localhost,root,,test;
connection root;
......
......@@ -4,7 +4,7 @@ set @saved_binlog_format = @@global.binlog_format;
create user mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
connect plain,localhost,mysqltest_1,,test;
connect root,localhost,root,,test;
**** Variable SQL_LOG_BIN ****
......
......@@ -132,15 +132,15 @@ END;
$$
SHOW GRANTS;
Grants for u1@localhost
GRANT USAGE ON *.* TO 'u1'@'localhost'
GRANT SELECT, CREATE ROUTINE ON "db1".* TO 'u1'@'localhost'
GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE "db1"."p1" TO 'u1'@'localhost'
GRANT USAGE ON *.* TO "u1"@"localhost"
GRANT SELECT, CREATE ROUTINE ON "db1".* TO "u1"@"localhost"
GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE "db1"."p1" TO "u1"@"localhost"
CALL p1;
DROP PROCEDURE p1;
SHOW GRANTS;
Grants for u1@localhost
GRANT USAGE ON *.* TO 'u1'@'localhost'
GRANT SELECT, CREATE ROUTINE ON "db1".* TO 'u1'@'localhost'
GRANT USAGE ON *.* TO "u1"@"localhost"
GRANT SELECT, CREATE ROUTINE ON "db1".* TO "u1"@"localhost"
#
# Now u1 can also CREATE, DROP its own package specifications
#
......@@ -157,14 +157,14 @@ FUNCTION f1 RETURN TEXT;
END latin1 latin1_swedish_ci latin1_swedish_ci
SHOW GRANTS;
Grants for u1@localhost
GRANT USAGE ON *.* TO 'u1'@'localhost'
GRANT SELECT, CREATE ROUTINE ON "db1".* TO 'u1'@'localhost'
GRANT EXECUTE, ALTER ROUTINE ON PACKAGE "db1"."pkg2" TO 'u1'@'localhost'
GRANT USAGE ON *.* TO "u1"@"localhost"
GRANT SELECT, CREATE ROUTINE ON "db1".* TO "u1"@"localhost"
GRANT EXECUTE, ALTER ROUTINE ON PACKAGE "db1"."pkg2" TO "u1"@"localhost"
DROP PACKAGE pkg2;
SHOW GRANTS;
Grants for u1@localhost
GRANT USAGE ON *.* TO 'u1'@'localhost'
GRANT SELECT, CREATE ROUTINE ON "db1".* TO 'u1'@'localhost'
GRANT USAGE ON *.* TO "u1"@"localhost"
GRANT SELECT, CREATE ROUTINE ON "db1".* TO "u1"@"localhost"
#
# Now u1 can also CREATE, DROP package bodies and EXECUTE package body routines
#
......@@ -184,9 +184,9 @@ FUNCTION f1 RETURN TEXT AS BEGIN RETURN 'This is pkg1.f1'; END;
END latin1 latin1_swedish_ci latin1_swedish_ci
SHOW GRANTS;
Grants for u1@localhost
GRANT USAGE ON *.* TO 'u1'@'localhost'
GRANT SELECT, CREATE ROUTINE ON "db1".* TO 'u1'@'localhost'
GRANT EXECUTE, ALTER ROUTINE ON PACKAGE BODY "db1"."pkg1" TO 'u1'@'localhost'
GRANT USAGE ON *.* TO "u1"@"localhost"
GRANT SELECT, CREATE ROUTINE ON "db1".* TO "u1"@"localhost"
GRANT EXECUTE, ALTER ROUTINE ON PACKAGE BODY "db1"."pkg1" TO "u1"@"localhost"
CALL pkg1.p1;
comment
This is pkg1.p1
......@@ -196,8 +196,8 @@ This is pkg1.f1
DROP PACKAGE BODY pkg1;
SHOW GRANTS;
Grants for u1@localhost
GRANT USAGE ON *.* TO 'u1'@'localhost'
GRANT SELECT, CREATE ROUTINE ON "db1".* TO 'u1'@'localhost'
GRANT USAGE ON *.* TO "u1"@"localhost"
GRANT SELECT, CREATE ROUTINE ON "db1".* TO "u1"@"localhost"
#
# Now create a PACKAGE BODY by root.
# u1 does not have EXECUTE access by default.
......@@ -232,9 +232,9 @@ u1@localhost
SET sql_mode=ORACLE;
SHOW GRANTS;
Grants for u1@localhost
GRANT USAGE ON *.* TO 'u1'@'localhost'
GRANT SELECT, CREATE ROUTINE ON "db1".* TO 'u1'@'localhost'
GRANT EXECUTE ON PACKAGE BODY "db1"."pkg1" TO 'u1'@'localhost'
GRANT USAGE ON *.* TO "u1"@"localhost"
GRANT SELECT, CREATE ROUTINE ON "db1".* TO "u1"@"localhost"
GRANT EXECUTE ON PACKAGE BODY "db1"."pkg1" TO "u1"@"localhost"
CALL pkg1.p1;
comment
This is pkg1.p1
......
......@@ -128,7 +128,7 @@ CREATE USER 'testuser1'@'localhost';
GRANT ALL ON *.* TO testuser1@localhost;
SHOW GRANTS FOR testuser1@localhost;
Grants for testuser1@localhost
GRANT ALL PRIVILEGES ON *.* TO 'testuser1'@'localhost'
GRANT ALL PRIVILEGES ON *.* TO `testuser1`@`localhost`
connect testuser1, localhost, testuser1, , test;
USE information_schema;
CREATE TABLE schemata ( c1 INT );
......
......@@ -5,8 +5,8 @@ CREATE user boo1;
GRANT select,create,alter,drop on foo.* to boo1;
SHOW GRANTS for boo1;
Grants for boo1@%
GRANT USAGE ON *.* TO 'boo1'@'%'
GRANT SELECT, CREATE, DROP, ALTER ON `foo`.* TO 'boo1'@'%'
GRANT USAGE ON *.* TO `boo1`@`%`
GRANT SELECT, CREATE, DROP, ALTER ON `foo`.* TO `boo1`@`%`
CREATE user boo2;
create database foo;
CONNECT con1,localhost, boo1,, foo;
......@@ -130,8 +130,8 @@ INSERT INTO t1 VALUES (1, 2), (2, 3);
GRANT SELECT (a) ON t1 TO foo;
SHOW GRANTS FOR foo;
Grants for foo@%
GRANT USAGE ON *.* TO 'foo'@'%'
GRANT SELECT (a) ON `db`.`t1` TO 'foo'@'%'
GRANT USAGE ON *.* TO `foo`@`%`
GRANT SELECT (a) ON `db`.`t1` TO `foo`@`%`
SELECT * FROM information_schema.check_constraints;
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
def db t1 CONSTRAINT_1 `b` > 0
......
......@@ -196,8 +196,8 @@ ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
connect testuser1, localhost, testuser1, , test;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
......@@ -205,8 +205,8 @@ ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
connection default;
GRANT SELECT (f1,f3) ON db_datadict.my_table TO 'testuser1'@'localhost';
SELECT * FROM information_schema.column_privileges
......@@ -217,9 +217,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
GRANT SELECT (f3, f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
GRANT SELECT (f3, f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection testuser1;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
......@@ -229,9 +229,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
GRANT SELECT (f3, f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
GRANT SELECT (f3, f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection default;
ALTER TABLE db_datadict.my_table DROP COLUMN f3;
GRANT UPDATE (f1) ON db_datadict.my_table TO 'testuser1'@'localhost';
......@@ -244,9 +244,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection testuser1;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
......@@ -257,9 +257,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
SELECT f1, f3 FROM db_datadict.my_table;
ERROR 42S22: Unknown column 'f3' in 'field list'
connection default;
......@@ -273,9 +273,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection testuser1;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
......@@ -286,9 +286,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection default;
DROP TABLE db_datadict.my_table;
SELECT * FROM information_schema.column_privileges
......@@ -300,9 +300,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection testuser1;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
......@@ -313,9 +313,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection default;
REVOKE ALL ON db_datadict.my_table FROM 'testuser1'@'localhost';
SELECT * FROM information_schema.column_privileges
......@@ -324,8 +324,8 @@ ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
connection testuser1;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
......@@ -333,8 +333,8 @@ ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
connection default;
disconnect testuser1;
DROP USER 'testuser1'@'localhost';
......
......@@ -124,10 +124,10 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
'testuser1'@'localhost' def db_datadict_4 SELECT YES
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT INSERT ON `db_datadict_1`.* TO 'testuser1'@'localhost'
GRANT SELECT ON `db_datadict_4`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
GRANT INSERT ON `db_datadict_2`.`t1` TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT INSERT ON `db_datadict_1`.* TO `testuser1`@`localhost`
GRANT SELECT ON `db_datadict_4`.* TO `testuser1`@`localhost` WITH GRANT OPTION
GRANT INSERT ON `db_datadict_2`.`t1` TO `testuser1`@`localhost`
SHOW GRANTS FOR 'testuser2'@'localhost';
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'mysql'
connect testuser2, localhost, testuser2, , test;
......@@ -147,10 +147,10 @@ SHOW GRANTS FOR 'testuser1'@'localhost';
ERROR 42000: Access denied for user 'testuser2'@'localhost' to database 'mysql'
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
GRANT USAGE ON *.* TO 'testuser2'@'localhost'
GRANT SELECT ON `db_datadict_3`.* TO 'testuser2'@'localhost'
GRANT SELECT ON `db_datadict_1`.* TO 'testuser2'@'localhost'
GRANT SELECT ON `db_datadict_4`.* TO 'testuser2'@'localhost'
GRANT USAGE ON *.* TO `testuser2`@`localhost`
GRANT SELECT ON `db_datadict_3`.* TO `testuser2`@`localhost`
GRANT SELECT ON `db_datadict_1`.* TO `testuser2`@`localhost`
GRANT SELECT ON `db_datadict_4`.* TO `testuser2`@`localhost`
connection default;
disconnect testuser1;
disconnect testuser2;
......@@ -165,16 +165,16 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
'testuser2'@'localhost' def db_datadict_4 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT INSERT ON `db_datadict_1`.* TO 'testuser1'@'localhost'
GRANT SELECT ON `db_datadict_4`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
GRANT INSERT ON `db_datadict_2`.`t1` TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT INSERT ON `db_datadict_1`.* TO `testuser1`@`localhost`
GRANT SELECT ON `db_datadict_4`.* TO `testuser1`@`localhost` WITH GRANT OPTION
GRANT INSERT ON `db_datadict_2`.`t1` TO `testuser1`@`localhost`
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
GRANT USAGE ON *.* TO 'testuser2'@'localhost'
GRANT SELECT ON `db_datadict_3`.* TO 'testuser2'@'localhost'
GRANT SELECT ON `db_datadict_1`.* TO 'testuser2'@'localhost'
GRANT SELECT ON `db_datadict_4`.* TO 'testuser2'@'localhost'
GRANT USAGE ON *.* TO `testuser2`@`localhost`
GRANT SELECT ON `db_datadict_3`.* TO `testuser2`@`localhost`
GRANT SELECT ON `db_datadict_1`.* TO `testuser2`@`localhost`
GRANT SELECT ON `db_datadict_4`.* TO `testuser2`@`localhost`
DROP USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
DROP DATABASE db_datadict_1;
......
......@@ -196,10 +196,10 @@ def db_datadict_2 t4 1 db_datadict_2 f2_ind 1 f2 NULL 0 NULL NULL YES HASH
def db_datadict_2 t4 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
GRANT USAGE ON *.* TO 'testuser2'@'localhost'
GRANT USAGE ON *.* TO `testuser2`@`localhost`
connect testuser1, localhost, testuser1, , test;
SELECT * FROM information_schema.statistics
WHERE table_schema LIKE 'db_datadict%'
......@@ -207,7 +207,7 @@ ORDER BY table_schema,table_name,index_name,seq_in_index,column_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT INDEX_COMMENT
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
SHOW GRANTS FOR 'testuser2'@'localhost';
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'mysql'
connect testuser2, localhost, testuser2, , test;
......@@ -219,7 +219,7 @@ SHOW GRANTS FOR 'testuser1'@'localhost';
ERROR 42000: Access denied for user 'testuser2'@'localhost' to database 'mysql'
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
GRANT USAGE ON *.* TO 'testuser2'@'localhost'
GRANT USAGE ON *.* TO `testuser2`@`localhost`
connection default;
GRANT SELECT ON db_datadict.t1 TO 'testuser1'@'localhost' WITH GRANT OPTION;
GRANT SELECT(f1,f5) ON db_datadict_2.t3 TO 'testuser1'@'localhost';
......@@ -239,12 +239,12 @@ def db_datadict_2 t4 1 db_datadict_2 f2_ind 1 f2 NULL 0 NULL NULL YES HASH
def db_datadict_2 t4 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT SELECT ON `db_datadict`.`t1` TO 'testuser1'@'localhost' WITH GRANT OPTION
GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT SELECT ON `db_datadict`.`t1` TO `testuser1`@`localhost` WITH GRANT OPTION
GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO `testuser1`@`localhost`
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
GRANT USAGE ON *.* TO 'testuser2'@'localhost'
GRANT USAGE ON *.* TO `testuser2`@`localhost`
connection testuser1;
SELECT * FROM information_schema.statistics
WHERE table_schema LIKE 'db_datadict%'
......@@ -258,9 +258,9 @@ def db_datadict_2 t3 0 db_datadict_2 f5 1 f5 NULL 0 NULL NULL YES HASH
def db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT SELECT ON `db_datadict`.`t1` TO 'testuser1'@'localhost' WITH GRANT OPTION
GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT SELECT ON `db_datadict`.`t1` TO `testuser1`@`localhost` WITH GRANT OPTION
GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO `testuser1`@`localhost`
SHOW GRANTS FOR 'testuser2'@'localhost';
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'mysql'
connection testuser2;
......@@ -272,13 +272,13 @@ SHOW GRANTS FOR 'testuser1'@'localhost';
ERROR 42000: Access denied for user 'testuser2'@'localhost' to database 'mysql'
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
GRANT USAGE ON *.* TO 'testuser2'@'localhost'
GRANT USAGE ON *.* TO `testuser2`@`localhost`
connection default;
REVOKE SELECT,GRANT OPTION ON db_datadict.t1 FROM 'testuser1'@'localhost';
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO `testuser1`@`localhost`
connection testuser1;
SELECT * FROM information_schema.statistics
WHERE table_schema LIKE 'db_datadict%'
......@@ -290,8 +290,8 @@ def db_datadict_2 t3 0 db_datadict_2 f5 1 f5 NULL 0 NULL NULL YES HASH
def db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO `testuser1`@`localhost`
connection default;
disconnect testuser1;
disconnect testuser2;
......
......@@ -109,8 +109,8 @@ CREATE USER 'testuser1'@'localhost';
GRANT SELECT(f5) ON db_datadict.t1 TO 'testuser1'@'localhost';
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT SELECT (f5) ON `db_datadict`.`t1` TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT SELECT (f5) ON `db_datadict`.`t1` TO `testuser1`@`localhost`
SELECT * FROM information_schema.table_constraints
WHERE table_schema = 'db_datadict'
ORDER BY table_schema,table_name, constraint_name;
......@@ -133,8 +133,8 @@ t2 0 PRIMARY 2 f2 ### ### ### ### ### ### ###
connect testuser1, localhost, testuser1, , db_datadict;
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT SELECT (f5) ON `db_datadict`.`t1` TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT SELECT (f5) ON `db_datadict`.`t1` TO `testuser1`@`localhost`
SELECT * FROM information_schema.table_constraints
WHERE table_schema = 'db_datadict'
ORDER BY table_schema,table_name, constraint_name;
......
......@@ -84,9 +84,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'testuser1'@'localhost' def db_datadict tb1 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT SELECT, CREATE ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
GRANT SELECT ON `db_datadict`.`tb1` TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT SELECT, CREATE ON `db_datadict`.* TO `testuser1`@`localhost` WITH GRANT OPTION
GRANT SELECT ON `db_datadict`.`tb1` TO `testuser1`@`localhost`
connect testuser2, localhost, testuser2, , db_datadict;
SELECT * FROM information_schema.table_privileges
WHERE table_name LIKE 'tb%'
......@@ -107,8 +107,8 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'testuser2'@'localhost' def db_datadict tb1 UPDATE YES
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
GRANT USAGE ON *.* TO 'testuser2'@'localhost'
GRANT ALL PRIVILEGES ON `db_datadict`.`tb1` TO 'testuser2'@'localhost' WITH GRANT OPTION
GRANT USAGE ON *.* TO `testuser2`@`localhost`
GRANT ALL PRIVILEGES ON `db_datadict`.`tb1` TO `testuser2`@`localhost` WITH GRANT OPTION
connect testuser3, localhost, testuser3, , db_datadict;
SELECT * FROM information_schema.table_privileges
WHERE table_name LIKE 'tb%'
......@@ -117,8 +117,8 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'testuser3'@'localhost' def db_datadict tb3 SELECT NO
SHOW GRANTS FOR 'testuser3'@'localhost';
Grants for testuser3@localhost
GRANT USAGE ON *.* TO 'testuser3'@'localhost'
GRANT SELECT ON `db_datadict`.`tb3` TO 'testuser3'@'localhost'
GRANT USAGE ON *.* TO `testuser3`@`localhost`
GRANT SELECT ON `db_datadict`.`tb3` TO `testuser3`@`localhost`
connection default;
disconnect testuser1;
disconnect testuser2;
......@@ -144,17 +144,17 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'testuser3'@'localhost' def db_datadict tb3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT SELECT, CREATE ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
GRANT SELECT ON `db_datadict`.`tb1` TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT SELECT, CREATE ON `db_datadict`.* TO `testuser1`@`localhost` WITH GRANT OPTION
GRANT SELECT ON `db_datadict`.`tb1` TO `testuser1`@`localhost`
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
GRANT USAGE ON *.* TO 'testuser2'@'localhost'
GRANT ALL PRIVILEGES ON `db_datadict`.`tb1` TO 'testuser2'@'localhost' WITH GRANT OPTION
GRANT USAGE ON *.* TO `testuser2`@`localhost`
GRANT ALL PRIVILEGES ON `db_datadict`.`tb1` TO `testuser2`@`localhost` WITH GRANT OPTION
SHOW GRANTS FOR 'testuser3'@'localhost';
Grants for testuser3@localhost
GRANT USAGE ON *.* TO 'testuser3'@'localhost'
GRANT SELECT ON `db_datadict`.`tb3` TO 'testuser3'@'localhost'
GRANT USAGE ON *.* TO `testuser3`@`localhost`
GRANT SELECT ON `db_datadict`.`tb3` TO `testuser3`@`localhost`
DROP USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
DROP USER 'testuser3'@'localhost';
......@@ -226,9 +226,9 @@ SHOW GRANTS FOR 'testuser1'@'localhost';
ERROR 42000: There is no such grant defined for user 'testuser1' on host 'localhost'
SHOW GRANTS FOR 'the_user'@'localhost';
Grants for the_user@localhost
GRANT USAGE ON *.* TO 'the_user'@'localhost'
GRANT ALL PRIVILEGES ON `test`.`t1_view` TO 'the_user'@'localhost'
GRANT ALL PRIVILEGES ON `test`.`t1_table` TO 'the_user'@'localhost'
GRANT USAGE ON *.* TO `the_user`@`localhost`
GRANT ALL PRIVILEGES ON `test`.`t1_view` TO `the_user`@`localhost`
GRANT ALL PRIVILEGES ON `test`.`t1_table` TO `the_user`@`localhost`
SELECT DISTINCT table_schema,table_name FROM information_schema.table_privileges
WHERE table_name LIKE 't1_%'
ORDER BY table_schema,table_name;
......@@ -246,9 +246,9 @@ test t1_table
test t1_view
SHOW GRANTS FOR 'the_user'@'localhost';
Grants for the_user@localhost
GRANT USAGE ON *.* TO 'the_user'@'localhost'
GRANT ALL PRIVILEGES ON `test`.`t1_view` TO 'the_user'@'localhost'
GRANT ALL PRIVILEGES ON `test`.`t1_table` TO 'the_user'@'localhost'
GRANT USAGE ON *.* TO `the_user`@`localhost`
GRANT ALL PRIVILEGES ON `test`.`t1_view` TO `the_user`@`localhost`
GRANT ALL PRIVILEGES ON `test`.`t1_table` TO `the_user`@`localhost`
REVOKE ALL PRIVILEGES ON test.t1_table FROM 'the_user'@'localhost';
REVOKE ALL PRIVILEGES ON test.t1_view FROM 'the_user'@'localhost';
DROP VIEW test.t1_view;
......
......@@ -145,8 +145,8 @@ trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE # testuser1@l
connect testuser2, localhost, testuser2, , db_datadict;
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
GRANT USAGE ON *.* TO 'testuser2'@'localhost'
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, DELETE HISTORY ON `db_datadict`.`t1` TO 'testuser2'@'localhost'
GRANT USAGE ON *.* TO `testuser2`@`localhost`
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, DELETE HISTORY ON `db_datadict`.`t1` TO `testuser2`@`localhost`
# No TRIGGER Privilege --> no result for query
SELECT * FROM information_schema.triggers
WHERE trigger_name = 'trg1';
......@@ -156,8 +156,8 @@ Trigger Event Table Statement Timing Created sql_mode Definer character_set_clie
connect testuser3, localhost, testuser3, , test;
SHOW GRANTS FOR 'testuser3'@'localhost';
Grants for testuser3@localhost
GRANT TRIGGER ON *.* TO 'testuser3'@'localhost'
GRANT SELECT ON `db_datadict`.`t1` TO 'testuser3'@'localhost'
GRANT TRIGGER ON *.* TO `testuser3`@`localhost`
GRANT SELECT ON `db_datadict`.`t1` TO `testuser3`@`localhost`
# TRIGGER Privilege + SELECT Privilege on t1 --> result for query
SELECT * FROM information_schema.triggers
WHERE trigger_name = 'trg1';
......@@ -169,7 +169,7 @@ trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE # testuser1@l
connect testuser4, localhost, testuser4, , test;
SHOW GRANTS FOR 'testuser4'@'localhost';
Grants for testuser4@localhost
GRANT TRIGGER ON *.* TO 'testuser4'@'localhost'
GRANT TRIGGER ON *.* TO `testuser4`@`localhost`
# TRIGGER Privilege + no SELECT Privilege on t1 --> result for query
SELECT * FROM db_datadict.t1;
ERROR 42000: SELECT command denied to user 'testuser4'@'localhost' for table 't1'
......
......@@ -546,9 +546,9 @@ default_role
max_statement_time 0.000000
SHOW GRANTS;
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT SELECT, UPDATE ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
GRANT SELECT ON `mysql`.`user` TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT SELECT, UPDATE ON `db_datadict`.* TO `testuser1`@`localhost` WITH GRANT OPTION
GRANT SELECT ON `mysql`.`user` TO `testuser1`@`localhost`
# Now add SELECT on *.* to testuser1;
connection default;
......@@ -1035,9 +1035,9 @@ default_role
max_statement_time 0.000000
SHOW GRANTS;
Grants for testuser1@localhost
GRANT SELECT ON *.* TO 'testuser1'@'localhost' WITH GRANT OPTION
GRANT SELECT, UPDATE ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
GRANT SELECT ON `mysql`.`user` TO 'testuser1'@'localhost'
GRANT SELECT ON *.* TO `testuser1`@`localhost` WITH GRANT OPTION
GRANT SELECT, UPDATE ON `db_datadict`.* TO `testuser1`@`localhost` WITH GRANT OPTION
GRANT SELECT ON `mysql`.`user` TO `testuser1`@`localhost`
connect testuser2, localhost, testuser2, , db_datadict;
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
......@@ -1055,7 +1055,7 @@ WHERE user LIKE 'testuser%' ORDER BY host, user;
ERROR 42000: SELECT command denied to user 'testuser2'@'localhost' for table 'user'
SHOW GRANTS;
Grants for testuser2@localhost
GRANT INSERT, UPDATE ON *.* TO 'testuser2'@'localhost'
GRANT INSERT, UPDATE ON *.* TO `testuser2`@`localhost`
connect testuser3, localhost, testuser3, , test;
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
......@@ -1069,7 +1069,7 @@ WHERE user LIKE 'testuser%' ORDER BY host, user;
ERROR 42000: SELECT command denied to user 'testuser3'@'localhost' for table 'user'
SHOW GRANTS;
Grants for testuser3@localhost
GRANT USAGE ON *.* TO 'testuser3'@'localhost'
GRANT USAGE ON *.* TO `testuser3`@`localhost`
# Revoke privileges from testuser1;
connection default;
......@@ -1249,7 +1249,7 @@ WHERE user LIKE 'testuser%' ORDER BY host, user;
ERROR 42000: SELECT command denied to user 'testuser1'@'localhost' for table 'user'
SHOW GRANTS;
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
CREATE TABLE db_datadict.tb_55 ( c1 TEXT );
ERROR 42000: CREATE command denied to user 'testuser1'@'localhost' for table 'tb_55'
SELECT * FROM information_schema.user_privileges
......@@ -1264,7 +1264,7 @@ WHERE user LIKE 'testuser%' ORDER BY host, user;
ERROR 42000: SELECT command denied to user 'testuser1'@'localhost' for table 'user'
SHOW GRANTS;
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
CREATE TABLE db_datadict.tb_66 ( c1 TEXT );
ERROR 42000: CREATE command denied to user 'testuser1'@'localhost' for table 'tb_66'
......@@ -1587,9 +1587,9 @@ default_role
max_statement_time 0.000000
SHOW GRANTS;
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT ALL PRIVILEGES ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
GRANT SELECT ON `mysql`.`user` TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT ALL PRIVILEGES ON `db_datadict`.* TO `testuser1`@`localhost` WITH GRANT OPTION
GRANT SELECT ON `mysql`.`user` TO `testuser1`@`localhost`
CREATE TABLE db_datadict.tb_56 ( c1 TEXT );
ERROR 42000: CREATE command denied to user 'testuser1'@'localhost' for table 'tb_56'
USE db_datadict;
......@@ -1745,9 +1745,9 @@ default_role
max_statement_time 0.000000
SHOW GRANTS;
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT ALL PRIVILEGES ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
GRANT SELECT ON `mysql`.`user` TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT ALL PRIVILEGES ON `db_datadict`.* TO `testuser1`@`localhost` WITH GRANT OPTION
GRANT SELECT ON `mysql`.`user` TO `testuser1`@`localhost`
CREATE TABLE tb_57 ( c1 TEXT )
ENGINE = <other_engine_type>;
......@@ -1929,7 +1929,7 @@ WHERE user LIKE 'testuser%' ORDER BY host, user;
ERROR 42000: SELECT command denied to user 'testuser1'@'localhost' for table 'user'
SHOW GRANTS;
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
CREATE TABLE db_datadict.tb_58 ( c1 TEXT )
ENGINE = <other_engine_type>;
USE db_datadict;
......@@ -1961,7 +1961,7 @@ PRIVILEGE_TYPE USAGE
IS_GRANTABLE NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT SELECT, FILE ON *.* TO 'testuser1'@'localhost';
SELECT * FROM information_schema.user_privileges
WHERE grantee = '''testuser1''@''localhost''';
......@@ -1975,7 +1975,7 @@ PRIVILEGE_TYPE FILE
IS_GRANTABLE NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT SELECT, FILE ON *.* TO 'testuser1'@'localhost'
GRANT SELECT, FILE ON *.* TO `testuser1`@`localhost`
DROP USER 'testuser1'@'localhost';
SELECT * FROM information_schema.user_privileges
WHERE grantee = '''testuser1''@''localhost''';
......
......@@ -36,8 +36,8 @@ GRANT ALL PRIVILEGES ON testdb_9401.t1 TO dummy@localhost;
FLUSH PRIVILEGES;
SHOW GRANTS FOR dummy@localhost;
Grants for dummy@localhost
GRANT USAGE ON *.* TO 'dummy'@'localhost'
GRANT ALL PRIVILEGES ON `testdb_9401`.`t1` TO 'dummy'@'localhost'
GRANT USAGE ON *.* TO `dummy`@`localhost`
GRANT ALL PRIVILEGES ON `testdb_9401`.`t1` TO `dummy`@`localhost`
REVOKE ALL PRIVILEGES, GRANT OPTION FROM dummy@localhost;
DROP USER dummy@localhost;
DROP DATABASE testdb_9401;
......
......@@ -10,8 +10,8 @@ current_user()
test1@localhost
SHOW GRANTS FOR CURRENT_USER;
Grants for test1@localhost
GRANT USAGE ON *.* TO 'test1'@'localhost'
GRANT SELECT, INSERT, CREATE, DROP ON `test`.* TO 'test1'@'localhost'
GRANT USAGE ON *.* TO `test1`@`localhost`
GRANT SELECT, INSERT, CREATE, DROP ON `test`.* TO `test1`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR 42000: ALTER command denied to user 'test1'@'localhost' for table 'tp'
disconnect test1;
......@@ -22,8 +22,8 @@ current_user()
test2@localhost
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
GRANT USAGE ON *.* TO 'test2'@'localhost'
GRANT SELECT, INSERT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO 'test2'@'localhost'
GRANT USAGE ON *.* TO `test2`@`localhost`
GRANT SELECT, INSERT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO `test2`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
SELECT * FROM t_10;
a b
......@@ -80,8 +80,8 @@ current_user()
test2@localhost
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
GRANT USAGE ON *.* TO 'test2'@'localhost'
GRANT SELECT, INSERT, UPDATE, CREATE, DROP ON `test`.* TO 'test2'@'localhost'
GRANT USAGE ON *.* TO `test2`@`localhost`
GRANT SELECT, INSERT, UPDATE, CREATE, DROP ON `test`.* TO `test2`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR 42000: ALTER command denied to user 'test2'@'localhost' for table 'tp'
SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment