-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
REVOKE ALL fails on current user #23850
Comments
I find it's caused by the 'Grant Option' privilege. According to the MySQL document https://dev.mysql.com/doc/refman/8.0/en/revoke.html, the privilege check rule for 'revoke some privilege':
However, the rule for 'revoke some privilege' and 'revoke all privilege' are different. 'revoke all privileges' check 'CREATE USER' and so on.
That is the root cause. |
I test with MySQL, and the result does not align to your "2. What did you expect to see? (Required)" description @morgo Do you mean the behavior in MySQL 8.0? |
Yes, I am comparing to MySQL 8.0. I discovered this issue when looking at MTR tests. |
Please edit this comment or add a new comment to complete the following informationBugNote: Make Sure that 'component', and 'severity' labels are added 1. Root Cause Analysis (RCA) (optional)The user name and host is empty for 'revoke .. from CURRENT_USER()', so the revoke statement fails. 2. Symptom (optional)Revoke ... from CURRENT_USER(), with this kind of error message:
3. All Trigger Conditions (optional)revoke from current_user() 4. Workaround (optional)N/A 5. Affected versions[v3.0.1:v3.0.999], [v4.0.1:v4.0.999], [v5.0.0:v5.0.999] 6. Fixed versionsmaster |
Bug Report
This was discovered by running mysql-test against TiDB. A user should have permission to revoke privileges from themselves as long as they have
CREATE USER
granted.This fails in TiDB because
ALL
is expanded into the all privileges mask + Grant priv.It also fails in the case that the privilege check is met (u4).
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: