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

privilege: add drop_priv check when truncate table #9870

Merged
merged 6 commits into from
Mar 24, 2019
Merged

Conversation

winkyao
Copy link
Contributor

@winkyao winkyao commented Mar 24, 2019

What problem does this PR solve?

Before this PR, TiDB user truncate table only needs delete_priv. After this PR, needs drop_priv. To be consistent with MySQL. https://dev.mysql.com/doc/refman/5.7/en/privileges-provided.html#priv_drop

What is changed and how it works?

Add drop_priv to the visitInfo in the plan builder.

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change

Side effects

  • Breaking backward compatibility

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

@winkyao
Copy link
Contributor Author

winkyao commented Mar 24, 2019

@tiancaiamao PTAL

@winkyao
Copy link
Contributor Author

winkyao commented Mar 24, 2019

@xiekeyi98 PTAL

@codecov
Copy link

codecov bot commented Mar 24, 2019

Codecov Report

Merging #9870 into master will increase coverage by 0.0037%.
The diff coverage is 100%.

@@               Coverage Diff                @@
##             master      #9870        +/-   ##
================================================
+ Coverage   67.3504%   67.3541%   +0.0037%     
================================================
  Files           383        383                
  Lines         80436      80436                
================================================
+ Hits          54174      54177         +3     
- Misses        21416      21417         +1     
+ Partials       4846       4842         -4

Copy link
Contributor

@xiekeyi98 xiekeyi98 left a comment

Choose a reason for hiding this comment

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

Do we only need drop privilege
Because :
image

Maybe we could delete delete privilege?

Rest LGTM

@winkyao
Copy link
Contributor Author

winkyao commented Mar 24, 2019

@xiekeyi98 Done.

Copy link
Contributor

@xiekeyi98 xiekeyi98 left a comment

Choose a reason for hiding this comment

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

LGTM

@xiekeyi98 xiekeyi98 added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 24, 2019
@tiancaiamao
Copy link
Contributor

LGTM

@tiancaiamao
Copy link
Contributor

/run-all-tests

@tiancaiamao tiancaiamao added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 24, 2019
@winkyao
Copy link
Contributor Author

winkyao commented Mar 24, 2019

/run-all-tests

Copy link
Contributor

@crazycs520 crazycs520 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/LGT2 Indicates that a PR has LGTM 2. type/compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants