-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
*: Fix use of user identity in SHOW GRANTS + error messages (#30294) #30474
Conversation
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/run-all-tests |
@morgo you're already a collaborator in bot's repo. |
/run-mysql-test |
This pull request is closed because its related version has closed automatic cherry-picking. https://prow.tidb.net/command-help#cherrypick |
cherry-pick #30294 to release-5.3
You can switch your code base to this Pull Request by using git-extras:
# In tidb repo: git pr https://github.com/pingcap/tidb/pull/30474
After apply modifications, you can push your change to this PR via:
What problem does this PR solve?
Issue Number: fixes #30279 (once new tidb-test PR merged as well)
Problem Summary:
#30204 revealed a bug (i.e. it's not specifically a regression introduced) where the column used in
show grants
is from the Hostname of the user that logged in, not the matching entry from the MySQL privileges table.Upon further inspection, it looks like we almost always intend to use the user from the privileges table and not the hostname of the logged in user. The exception is the
USER()
sql function.(MySQL is actually inconsistent in which hostname it uses in error messages. The important case is with
SHOW GRANTS FOR CURRENT_USER()
which is used in integration tests.)What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note