-
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
planner, privilege: check user priv on SET GLOBAL #8837
Conversation
PTAL @tiancaiamao , thx! |
/run-all-tests |
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
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
Codecov Report
@@ Coverage Diff @@
## master #8837 +/- ##
=========================================
Coverage ? 67.54%
=========================================
Files ? 363
Lines ? 75101
Branches ? 0
=========================================
Hits ? 50725
Misses ? 19903
Partials ? 4473
Continue to review full report at Codecov.
|
What problem does this PR solve?
Fixes #7403
What is changed and how it works?
Checks that
SET GLOBAL
requires the super privilege. Does not check any session level vars - I took a look, and I don't believe any in TiDB require privilege check.(In MySQL commands like
SET SESSION sql_log_bin=0
require super privs, but I believe this is not applicable to TiDB).It is not 100% compatible with MySQL, since the error codes/messages differ, but this is not a new issue, and is inherint to all checking in
visitInfo
. I will create a separate issue to discuss how to enhance it, since I think it should have an argument to pass the error message on failure.Check List
Tests
Code changes
Side effects
Related changes
This change is