-
Notifications
You must be signed in to change notification settings - Fork 490
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
parser, ast: add SET ROLE
support
#228
Conversation
LGTM |
tidb pr: pingcap/tidb#9581 |
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.
Rest LGTM
ast/misc.go
Outdated
case SetRoleAllExcept: | ||
ctx.WriteKeyWord(" ALL EXCEPT") | ||
} | ||
if len(n.RoleList) > 0 { |
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.
This check is unnecessary.
go.mod1
Outdated
@@ -11,6 +11,7 @@ require ( | |||
github.com/pingcap/errors v0.11.0 | |||
github.com/pingcap/tidb v0.0.0-20190218065808-69472bd1a6e9 | |||
github.com/pingcap/tipb v0.0.0-20190107072121-abbec73437b7 | |||
github.com/shirou/gopsutil v2.18.12+incompatible // indirect |
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.
Where is this used? 🤔
fixed @kennytm |
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?
SET ROLE
is an important part of RBAC function. Many other RBAC grammar rely onSET ROLE
. The detail document forSET ROLE
is here : https://dev.mysql.com/doc/refman/8.0/en/set-role.htmlWhat is changed and how it works?
Adding
RoleIdentity
andSetRoleStmt
forast
package, which contain information about those role is going to be active.Check List
Tests
Code changes
Side effects