mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-20076: SHOW GRANTS does not quote role names properly
Quotes added to output.
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user