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

Added ReferencesPriv to DB and Table level, see tidb issue 26703 #1304

Merged

Conversation

mjonss
Copy link
Contributor

@mjonss mjonss commented Aug 10, 2021

What problem does this PR solve?

Parser related fix for pingcap/tidb#26703 (ReferencesPriv needs to be on both DB/Schema and Table level).

What is changed and how it works?

In MySQL, the REFERENCES privilege can be on both DB and Table level, the Parser definition AllDBPrivs and AllTablePrivs did not include ReferencesPriv which made TiDB fail when checking it.

Check List

Tests

  • Manual test (add detailed scripts or steps below)
    • Built TiDB with go.mod change replace github.com/pingcap/parser => ../parser to build tidb-server with the locally changed parser repository
    • Tested CREATE USER r;, CREATE SCHEMA reftest;, USE reftest, CREATE TABLE t (a int);, GRANT REFERENCES ON reftest.* TO r; and GRANT REFERENCES ON reftest.t TO r; which did succeed, just like in MySQL.

Code changes

  • Has exported variable/fields change: AllDBPrivs and AllTablePrivs

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Aug 10, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • kennytm
  • morgo

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@mjonss
Copy link
Contributor Author

mjonss commented Aug 10, 2021

/cc @morgo Could you please review this?

@morgo morgo self-requested a review August 10, 2021 18:55
@ti-chi-bot ti-chi-bot added status/LGT2 LGT2 and removed status/LGT1 LGT1 labels Aug 12, 2021
@xiongjiwei
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: fa902a8

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #1363.

tangenta pushed a commit that referenced this pull request Oct 25, 2021
…) (#1363)

* Added ReferencesPriv to DB and Table level, see tidb issue 26703

* Test found missing lookup for ReferencesPriv on table level

Co-authored-by: Mattias Jonsson <mattias.jonsson@pingcap.com>
@mjonss mjonss deleted the grant-references-table-level-tidb-issue-26703 branch October 25, 2021 13:44
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.

6 participants