-
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: add DROP ROLE
support
#237
Conversation
DROP ROLE
supportDROP ROLE
support
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
@@ -2429,19 +2429,31 @@ DropViewStmt: | |||
DropUserStmt: | |||
"DROP" "USER" UsernameList | |||
{ | |||
$$ = &ast.DropUserStmt{IfExists: false, UserList: $3.([]*auth.UserIdentity)} | |||
$$ = &ast.DropUserStmt{IsDropRole: false, IfExists: false, UserList: $3.([]*auth.UserIdentity)} |
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.
how about using a new DropRoleStmt
?
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.
actually there is no difference between DROP USER
and DROP ROLE
. I think IsDropRole
can be removed.
LGTM |
What problem does this PR solve?
add
DROP ROLE
function for parser and executor.What is changed and how it works?
Role is same as user, is store in
mysql.user
table. We do same action asDROP USER
when we need to drop a role. Also, as we has added some system table for RBAC, likemysql.role_edges
andmysql.default_role
. We have to delete information from these tables when executeDROP ROLE
tidb pr: pingcap/tidb#9616
Check List
Tests
Code changes
Side effects