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) #1363

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #1304

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 Author

ti-chi-bot commented Oct 25, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • kennytm
  • tangenta

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.

@ti-chi-bot ti-chi-bot added status/LGT2 LGT2 and removed status/LGT1 LGT1 labels Oct 25, 2021
@tangenta tangenta merged commit 871a76d into pingcap:release-5.2 Oct 25, 2021
@tangenta tangenta mentioned this pull request Oct 26, 2021
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants