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

executor: add `DROP ROLE` support #9616

Merged
merged 7 commits into from Mar 13, 2019

Conversation

@imtbkcat
Copy link
Contributor

commented Mar 8, 2019

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 as DROP USER when we need to drop a role. Also, as we has added some system table for RBAC, like mysql.role_edges and
mysql.default_role. We have to delete information from these tables when execute DROP ROLE

Check List

Tests

  • Unit test

Code changes

  • Has exported variable/fields change

Side effects

  • Increased code complexity
@imtbkcat

This comment has been minimized.

Copy link
Contributor Author

commented Mar 8, 2019

parser pr: pingcap/parser#237

@zhouqiang-cl

This comment has been minimized.

Copy link
Member

commented Mar 9, 2019

/run-all-tests

@tiancaiamao
Copy link
Contributor

left a comment

Could drop role statement drop an user, or drop user statement drop an role in MySQL? @imtbkcat

@imtbkcat

This comment has been minimized.

Copy link
Contributor Author

commented Mar 12, 2019

@tiancaiamao yes, drop role can drop user and drop user can also drop role.

@tiancaiamao

This comment has been minimized.

Copy link
Contributor

commented Mar 12, 2019

LGTM

@jackysp

This comment has been minimized.

Copy link
Member

commented Mar 12, 2019

@imtbkcat imtbkcat force-pushed the imtbkcat:droprole branch from 6449b56 to 58ce189 Mar 12, 2019

@imtbkcat

This comment has been minimized.

Copy link
Contributor Author

commented Mar 12, 2019

/run-all-tests

@codecov

This comment has been minimized.

Copy link

commented Mar 12, 2019

Codecov Report

Merging #9616 into master will decrease coverage by 0.0368%.
The diff coverage is 21.875%.

@@               Coverage Diff                @@
##             master      #9616        +/-   ##
================================================
- Coverage   67.3912%   67.3544%   -0.0369%     
================================================
  Files           377        377                
  Lines         79353      79383        +30     
================================================
- Hits          53477      53468         -9     
- Misses        21104      21134        +30     
- Partials       4772       4781         +9
@imtbkcat

This comment has been minimized.

Copy link
Contributor Author

commented Mar 13, 2019

PTAL @jackysp

@jackysp
Copy link
Member

left a comment

LGTM

imtbkcat added some commits Mar 13, 2019

@imtbkcat imtbkcat merged commit d4bad4e into pingcap:master Mar 13, 2019

8 checks passed

ci/circleci Your tests passed on CircleCI!
Details
codecov/patch 21.875% of diff hit (target 0%)
Details
codecov/project 67.3544% (-0.0369%) compared to 7f27f7d
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
idc-jenkins-ci-tidb/build Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/code_coverage Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.