-
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
privilege: fix user change after show grants
and add user existed check for show grants
(#19568)
#19587
privilege: fix user change after show grants
and add user existed check for show grants
(#19568)
#19587
Conversation
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
/run-all-tests |
@imtbkcat please accept the invitation then you can push to the cherry-pick pull requests. |
Please resolve conflict @imtbkcat |
@imtbkcat compile failed PTAL |
bcf5fd0
to
b7f211b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/merge |
Your auto merge job has been accepted, waiting for:
|
/run-all-tests |
@ti-srebot merge failed. |
/merge |
/run-sqllogic-test-2 |
/run-all-tests |
cherry-pick #19568 to release-3.0
What problem does this PR solve?
Issue Number: close #18878
Problem Summary:
select user()
returns different result after executeshow grants
show grants
can show grants on not existed user.What is changed and how it works?
What's Changed:
auth.UserIdentity
pointer on show grants.showGrants
to avoid executed on not existed user.How it Works:
Because of
SHOW GRANTS
change the content inauth.Identity
, when executeSHOW GRANTS
, it will change the host ofUser
in session variable. The result ofselect user()
will changed.Related changes
Check List
Tests
Side effects
Release note
SHOW GRANTS
can show grants for not existed user.