Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect usage of DB GRANT and NON-DB PRIVILEGES #32891

Closed
morgo opened this issue Mar 8, 2022 · 0 comments · Fixed by #32893
Closed

Incorrect usage of DB GRANT and NON-DB PRIVILEGES #32891

morgo opened this issue Mar 8, 2022 · 0 comments · Fixed by #32893
Assignees
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@morgo
Copy link
Contributor

morgo commented Mar 8, 2022

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create user u1;
GRANT CREATE TEMPORARY TABLES,DELETE,EXECUTE,INSERT,SELECT,SHOW VIEW,TRIGGER,UPDATE ON `test`.* TO `u1`; -- user exists
GRANT CREATE TEMPORARY TABLES,DELETE,EXECUTE,INSERT,SELECT,SHOW VIEW,TRIGGER,UPDATE ON `test`.* TO `u2`; 

2. What did you expect to see? (Required)

mysql [localhost:8028] {root} (test) > GRANT CREATE TEMPORARY TABLES,DELETE,EXECUTE,INSERT,SELECT,SHOW VIEW,TRIGGER,UPDATE ON `test`.* TO `u1`;
Query OK, 0 rows affected (0.00 sec)

mysql [localhost:8028] {root} (test) > GRANT CREATE TEMPORARY TABLES,DELETE,EXECUTE,INSERT,SELECT,SHOW VIEW,TRIGGER,UPDATE ON `test`.* TO `u2`;
ERROR 1410 (42000): You are not allowed to create a user with GRANT

3. What did you see instead (Required)

tidb> create user u1;
Query OK, 0 rows affected (0.01 sec)

tidb> GRANT CREATE TEMPORARY TABLES,DELETE,EXECUTE,INSERT,SELECT,SHOW VIEW,TRIGGER,UPDATE ON `test`.* TO `u1`; -- user exists
ERROR 1221 (HY000): Incorrect usage of DB GRANT and NON-DB PRIVILEGES
tidb> GRANT CREATE TEMPORARY TABLES,DELETE,EXECUTE,INSERT,SELECT,SHOW VIEW,TRIGGER,UPDATE ON `test`.* TO `u2`; 
ERROR 1105 (HY000): runtime error: invalid memory address or nil pointer dereference

4. What is your TiDB version? (Required)

tidb> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v5.5.0-alpha-406-g67789193d-dirty
Edition: Community
Git Commit Hash: 67789193da312967f486ae51fb85787446c3fd53
Git Branch: remove-memory-vars
UTC Build Time: 2022-03-02 01:07:22
GoVersion: go1.16.9
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants