Skip to content

parser, ast: add SET ROLE support#228

Merged
tiancaiamao merged 8 commits intopingcap:masterfrom
imtbkcat:setrole
Mar 20, 2019
Merged

parser, ast: add SET ROLE support#228
tiancaiamao merged 8 commits intopingcap:masterfrom
imtbkcat:setrole

Conversation

@imtbkcat
Copy link
Copy Markdown

@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

Comment thread go.mod1 Outdated
Comment thread auth/auth.go Outdated
@tiancaiamao
Copy link
Copy Markdown
Collaborator

LGTM

@imtbkcat
Copy link
Copy Markdown
Author

imtbkcat commented Mar 7, 2019

tidb pr: pingcap/tidb#9581

@tiancaiamao
Copy link
Copy Markdown
Collaborator

PTAL @jackysp @lysu @kennytm

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

Comment thread ast/misc.go Outdated
case SetRoleAllExcept:
ctx.WriteKeyWord(" ALL EXCEPT")
}
if len(n.RoleList) > 0 {
Copy link
Copy Markdown
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.

Comment thread go.mod1 Outdated
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
Copy Markdown
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
Copy Markdown
Author

fixed @kennytm

kennytm
kennytm previously approved these changes Mar 18, 2019
Copy link
Copy Markdown
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