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

planner/core: raise 'No database selected' error for grant statement #13745

Merged
merged 6 commits into from
Nov 27, 2019

Conversation

tiancaiamao
Copy link
Contributor

@tiancaiamao tiancaiamao commented Nov 26, 2019

What problem does this PR solve?

MySQL:

mysql> grant select on test1111 to test@"%" ;
ERROR 1046 (3D000): No database selected

TiDB:

mysql> grant select on test1111 to test@"%" ;
Query OK, 0 rows affected (0.05 sec)

What is changed and how it works?

If no database is selected, grant privilege to table should raise an error.

Check List

Tests

  • Unit test

@codecov
Copy link

codecov bot commented Nov 26, 2019

Codecov Report

Merging #13745 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #13745   +/-   ##
===========================================
  Coverage   80.2474%   80.2474%           
===========================================
  Files           474        474           
  Lines        117048     117048           
===========================================
  Hits          93928      93928           
  Misses        15758      15758           
  Partials       7362       7362

@tiancaiamao
Copy link
Contributor Author

PTAL @jackysp @lysu

Copy link

@imtbkcat imtbkcat left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@lysu lysu left a comment

Choose a reason for hiding this comment

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

LGTM

@lysu lysu added needs-cherry-pick-3.0 status/LGT2 Indicates that a PR has LGTM 2. and removed needs-cherry-pick-3.0 labels Nov 26, 2019
@zz-jason zz-jason added the status/can-merge Indicates a PR has been approved by a committer. label Nov 26, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Nov 26, 2019

Your auto merge job has been accepted, waiting for 13300

@zz-jason
Copy link
Member

@tiancaiamao should we cherry pick this PR to release 3.0 and release 3.1?

@sre-bot
Copy link
Contributor

sre-bot commented Nov 26, 2019

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Nov 26, 2019

@tiancaiamao merge failed.

@tiancaiamao
Copy link
Contributor Author

/run-all-tests

@tiancaiamao
Copy link
Contributor Author

/run-all-tests

@tiancaiamao tiancaiamao merged commit 1c59a53 into pingcap:master Nov 27, 2019
@tiancaiamao tiancaiamao deleted the grant-no-db-select branch November 27, 2019 12:41
@sre-bot
Copy link
Contributor

sre-bot commented Nov 27, 2019

cherry pick to release-3.0 failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/privilege status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants