Skip to content
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

Merged
merged 8 commits into from
Mar 20, 2019
Merged

Conversation

imtbkcat
Copy link

@imtbkcat imtbkcat commented Mar 1, 2019

What problem does this PR solve?

SET ROLE is an important part of RBAC function. Many other RBAC grammar rely on SET ROLE. The detail document for SET ROLE is here : https://dev.mysql.com/doc/refman/8.0/en/set-role.html

What is changed and how it works?

Adding RoleIdentity and SetRoleStmt for ast package, which contain information about those role is going to be active.

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change

Side effects

  • Increased code complexity

go.mod1 Outdated Show resolved Hide resolved
auth/auth.go Outdated Show resolved Hide resolved
@tiancaiamao
Copy link
Collaborator

LGTM

@imtbkcat
Copy link
Author

imtbkcat commented Mar 7, 2019

tidb pr: pingcap/tidb#9581

@tiancaiamao
Copy link
Collaborator

PTAL @jackysp @lysu @kennytm

Copy link
Contributor

@kennytm kennytm left a 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 {
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this used? 🤔

@imtbkcat
Copy link
Author

fixed @kennytm

kennytm
kennytm previously approved these changes Mar 18, 2019
Copy link
Contributor

@kennytm kennytm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@tiancaiamao tiancaiamao merged commit fe243e3 into pingcap:master Mar 20, 2019
@kennytm kennytm mentioned this pull request May 10, 2020
tiancaiamao pushed a commit to tiancaiamao/parser that referenced this pull request Apr 27, 2021
lyonzhi pushed a commit to lyonzhi/parser that referenced this pull request Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants