Details
Description
I noticed that MDEV-20076 is fixed already.
However, this is still minor issue left for SET DEFAULT ROLE
MariaDB [(none)]> show grants for 'exploit'@'host'; |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| Grants for exploit@host | |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| GRANT `role-exploit` TO `exploit`@`host` |
|
| GRANT USAGE ON *.* TO `exploit`@`host` IDENTIFIED BY PASSWORD '*' WITH MAX_STATEMENT_TIME 15.000000 | |
| SET DEFAULT ROLE role-exploit FOR 'exploit'@'host' |
If copy-pasted as-is, the last line gets a syntax error.
Can you update it so when showing grants, all of them are properly quoted?
SHOW GRANTS does not quote role names properly for DEFAULT ROLE
Attachments
Issue Links
- relates to
-
MDEV-20076 SHOW GRANTS does not quote role names properly
-
- Closed
-
-
MDEV-22313 SHOW GRANTS does not prints a user's default role
-
- Closed
-
10.2 is using ' instead of ` so we will proceed with single quotes in 10.2, while in 10.3 (commit fafb35ee517f309d9e507f6e3908caca5d8cd257 used ` and we will use them too in 10.3. I guess serg is ok with that.
Note that in 10.2 grant <role-x> TO .. in SHOW GRANT is also affected:
-GRANT test_role TO 'root'@'localhost' WITH ADMIN OPTION
+GRANT 'test_role' TO 'root'@'localhost' WITH ADMIN OPTION
-SET DEFAULT ROLE test_role FOR 'root'@'localhost'
+SET DEFAULT ROLE 'test_role' FOR 'root'@'localhost'