-
Notifications
You must be signed in to change notification settings - Fork 490
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
Added ReferencesPriv to DB and Table level, see tidb issue 26703 #1304
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/cc @morgo Could you please review this? |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: fa902a8
|
In response to a cherrypick label: new pull request created: #1363. |
…) (#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>
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 definitionAllDBPrivs
andAllTablePrivs
did not includeReferencesPriv
which made TiDB fail when checking it.Check List
Tests
go.mod
changereplace github.com/pingcap/parser => ../parser
to build tidb-server with the locally changed parser repositoryCREATE USER r;
,CREATE SCHEMA reftest;
,USE reftest
,CREATE TABLE t (a int);
,GRANT REFERENCES ON reftest.* TO r;
andGRANT REFERENCES ON reftest.t TO r;
which did succeed, just like in MySQL.Code changes
AllDBPrivs
andAllTablePrivs