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

executor: fix revoke result view bug #38552

Merged
merged 16 commits into from
Oct 28, 2022

Conversation

wxbty
Copy link
Contributor

@wxbty wxbty commented Oct 19, 2022

Signed-off-by: x-shadow-man [email protected]

Fix bug in issue #38421
also on column-level privilege

What problem does this PR solve?

This pr mainly fixes the bug of 38421.
To this end, I added new unit test【TestRevokeTableSingle、TestRevokeTableSingleColumn】, and also modified the involved unit tests【TestRevokeTableScope、TestRevokeColumnScope】.

Issue Number: close #38421

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Oct 19, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • dveeden
  • xhebox

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 do-not-merge/invalid-title release-note-none Denotes a PR that doesn't merit a release note. labels Oct 19, 2022
@ti-chi-bot
Copy link
Member

Welcome @wxbty!

It looks like this is your first PR to pingcap/tidb 🎉.

I'm the bot to help you request reviewers, add labels and more, See available commands.

We want to make sure your contribution gets all the attention it needs!



Thank you, and welcome to pingcap/tidb. 😃

@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 19, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Oct 19, 2022

CLA assistant check
All committers have signed the CLA.

@wxbty wxbty changed the title fix bug "User information exists after the privileges are revoked in mysql.tables_priv" executor: fix revoke result view bug Oct 19, 2022
@wxbty
Copy link
Contributor Author

wxbty commented Oct 20, 2022

/cc @cfzjywxk @you06

@wxbty
Copy link
Contributor Author

wxbty commented Oct 26, 2022

hi, @dveeden This pr also wants to get your advice,thx

Copy link
Contributor

@xhebox xhebox left a comment

Choose a reason for hiding this comment

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

LGTM otherwise

executor/revoke.go Outdated Show resolved Hide resolved
executor/revoke_test.go Show resolved Hide resolved
@wxbty wxbty requested review from xhebox and removed request for dveeden, cfzjywxk and you06 October 26, 2022 07:25
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Oct 26, 2022
@wxbty
Copy link
Contributor Author

wxbty commented Oct 26, 2022

/cc @dveeden

Copy link
Contributor

@you06 you06 left a comment

Choose a reason for hiding this comment

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

LGTM
Can you help fix a similar issue on column-level privilege?

CREATE user test;
GRANT SELECT(`Host`) ON `mysql`.`db` TO test;
REVOKE SELECT(`Host`) ON `mysql`.`db` FROM test;
SELECT * FROM `mysql`.`columns_priv`; -- Expected empty result set, but got the following rows
+------+-------+------+------------+-------------+---------------------+-------------+
| Host | DB    | User | Table_name | Column_name | Timestamp           | Column_priv |
+------+-------+------+------------+-------------+---------------------+-------------+
| %    | mysql | test | db         | Host        | 2022-10-26 16:01:23 |             |
+------+-------+------+------------+-------------+---------------------+-------------+
1 row in set (0.002 sec)

@wxbty
Copy link
Contributor Author

wxbty commented Oct 26, 2022

LGTM Can you help fix a similar issue on column-level privilege?

CREATE user test;
GRANT SELECT(`Host`) ON `mysql`.`db` TO test;
REVOKE SELECT(`Host`) ON `mysql`.`db` FROM test;
SELECT * FROM `mysql`.`columns_priv`; -- Expected empty result set, but got the following rows
+------+-------+------+------------+-------------+---------------------+-------------+
| Host | DB    | User | Table_name | Column_name | Timestamp           | Column_priv |
+------+-------+------+------------+-------------+---------------------+-------------+
| %    | mysql | test | db         | Host        | 2022-10-26 16:01:23 |             |
+------+-------+------+------------+-------------+---------------------+-------------+
1 row in set (0.002 sec)

ok

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Oct 26, 2022
@xhebox
Copy link
Contributor

xhebox commented Oct 28, 2022

I have the permission of the x-shadow man repository, but I can't find the modification of the allow maintainers to edti option.

The button should be somewhere at the right side panel.

I think it is only available when pr is just opened. Do I need to reopen a pr? Or try again?

It is up to you. I suggest opening another PR with your repo will be easy. I'll merge the PR when I am notified.

Then Why does the merge operation take so long? until timeout

CI is always unstable somehow. And it does take a long time to run all tests.

@xhebox
Copy link
Contributor

xhebox commented Oct 28, 2022

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 8f840a0

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Oct 28, 2022
@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Oct 28, 2022
@xhebox
Copy link
Contributor

xhebox commented Oct 28, 2022

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 59b4bfd

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Oct 28, 2022
@wxbty
Copy link
Contributor Author

wxbty commented Oct 28, 2022

/merge

When ci is passed, maybe you will merge successfully.

@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Oct 28, 2022
@xhebox
Copy link
Contributor

xhebox commented Oct 28, 2022

/merge

When ci is passed, maybe you will merge successfully.

Yes, so I tag it as mergeable first. So I don't need to watch the PR to see tests are passed or not.

@xhebox
Copy link
Contributor

xhebox commented Oct 28, 2022

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 0cbd221

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Oct 28, 2022
@wxbty
Copy link
Contributor Author

wxbty commented Oct 28, 2022

/merge

When ci is passed, maybe you will merge successfully.

Yes, so I tag it as mergeable first. So I don't need to watch the PR to see tests are passed or not.

If this time unsuccessful, I will reopen it, I know how the new pr is set up

@wxbty wxbty closed this Oct 28, 2022
@wxbty wxbty reopened this Oct 28, 2022
@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Oct 28, 2022
@wxbty
Copy link
Contributor Author

wxbty commented Oct 28, 2022

/merhe

typo

@xhebox
Copy link
Contributor

xhebox commented Oct 28, 2022

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 4521a06

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Oct 28, 2022
@ti-chi-bot ti-chi-bot merged commit 582d18a into pingcap:master Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User information exists after the privileges are revoked in mysql.tables_priv
6 participants