Skip to content

SHOW GRANTS doesn't show grants correctly #3589

@jycor

Description

@jycor

dolt:

test_db> create user test_user;
Query OK, 0 rows affected
test_db> show grants for test_user;
+--------------------------------------+
| Grants for test_user@%               |
+--------------------------------------+
| GRANT USAGE ON *.* TO `test_user`@`` |
+--------------------------------------+
test_db> grant select on test_db.* to test_user;
Query OK, 0 rows affected
test_db> show grants for test_user;
+--------------------------------------+
| Grants for test_user@%               |
+--------------------------------------+
| GRANT USAGE ON *.* TO `test_user`@`` |
+--------------------------------------+

mysql:

mysql> create user test_user;
Query OK, 0 rows affected (0.0037 sec)
mysql> show grants for test_user;
+---------------------------------------+
| Grants for test_user@%                |
+---------------------------------------+
| GRANT USAGE ON *.* TO `test_user`@`%` |
+---------------------------------------+
mysql> grant select on test_db.* to test_user;
Query OK, 0 rows affected (0.0033 sec)
mysql> show grants for test_user;
+------------------------------------------------+
| Grants for test_user@%                         |
+------------------------------------------------+
| GRANT USAGE ON *.* TO `test_user`@`%`          |
| GRANT SELECT ON `test_db`.* TO `test_user`@`%` |
+------------------------------------------------+

However, the privileges do appear to work (prevents test_user from everything other than selecting from test_db), so this is just a problem with show grants.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions