-
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, executor: support SET DEFAULT ROLE
#9949
Conversation
Codecov Report
@@ Coverage Diff @@
## master #9949 +/- ##
================================================
- Coverage 77.9619% 77.8868% -0.0751%
================================================
Files 405 405
Lines 82244 82381 +137
================================================
+ Hits 64119 64164 +45
- Misses 13392 13456 +64
- Partials 4733 4761 +28 |
/run-all-tests |
parser pr: pingcap/parser#266 |
LGTM |
executor/simple.go
Outdated
} | ||
e.done = true | ||
return err | ||
} | ||
|
||
func (e *SimpleExec) setDefaultRoleNone(s *ast.SetDefaultRoleStmt) error { | ||
if _, err := e.ctx.(sqlexec.SQLExecutor).Execute(context.Background(), "begin"); err != nil { |
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.
could we avoid repeatedly using the interface assert?
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.
PTAL @jackysp
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
What problem does this PR solve?
Support
SET DEFAULT ROLE
gramma.See https://dev.mysql.com/doc/refman/8.0/en/set-default-role.html for detail
What is changed and how it works?
When
SET DEFAULT ROLE
for some users, we clear their data inmysql.default_roles
and insert new default role information intomysql.default_roles
.Things need to be pay attention is handling error when insert transaction failed.
Check List
Tests
Code changes
Side effects