-
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
executor, privileges: fix privileges check fail for SET DEFAULT ROLE
#11201
Conversation
Codecov Report
@@ Coverage Diff @@
## master #11201 +/- ##
===========================================
Coverage ? 81.0424%
===========================================
Files ? 423
Lines ? 90022
Branches ? 0
===========================================
Hits ? 72956
Misses ? 11780
Partials ? 5286 |
Codecov Report
@@ Coverage Diff @@
## master #11201 +/- ##
===========================================
Coverage 81.9629% 81.9629%
===========================================
Files 434 434
Lines 95276 95276
===========================================
Hits 78091 78091
Misses 11744 11744
Partials 5441 5441 |
/run-all-tests tidb-test=pr/847 |
PTAL @tiancaiamao @lysu |
func (e *SimpleExec) releaseSysSession(ctx sessionctx.Context) { | ||
dom := domain.GetDomain(e.ctx) | ||
sysSessionPool := dom.SysSessionPool() | ||
sysSessionPool.Put(ctx.(pools.Resource)) |
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.
sysSessionPool.Put(ctx)
should work, and import "github.com/ngaut/pools" is not necessary.
LGTM @lysu |
/run-all-tests |
/run-all-tests |
/run-unit-test |
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
/run-all-tests |
cherry pick to release-3.0 in PR #11774 |
What problem does this PR solve?
fix #11165
SET DEFAULT ROLE
should always be avaible forcurrent_user
What is changed and how it works?
Implement
setDefaultRoleForCurrentUser
.Remove original privilege check for
SET DEFAULT ROLE
.Add new privilege check for
SET DEFAULT ROLE
.If is setting default role for current user, just skip check and call
setDefaultRoleForCurrentUser
.Check List
Tests
Code changes
Side effects
Related changes