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

privilege: fix privilege problem after upgrade (#14177) #14178

Merged
merged 2 commits into from
Dec 23, 2019

Conversation

imtbkcat
Copy link

What problem does this PR solve?

cherry-pick (#14177)

@imtbkcat
Copy link
Author

manual test in this way:

create user with all privilege in v3.0.5:

mysql> create user t1;
Query OK, 0 rows affected (0.00 sec)

mysql> create user t2;
Query OK, 0 rows affected (0.01 sec)

mysql> grant all on *.* to t1;
Query OK, 0 rows affected (0.00 sec)

mysql> select * from mysql.user where user='t1'\G;
*************************** 1. row ***************************
                 Host: %
                 User: t1
             Password:
          Select_priv: Y
          Insert_priv: Y
          Update_priv: Y
          Delete_priv: Y
          Create_priv: Y
            Drop_priv: Y
         Process_priv: Y
           Grant_priv: Y
      References_priv: Y
           Alter_priv: Y
         Show_db_priv: Y
           Super_priv: Y
Create_tmp_table_priv: N
     Lock_tables_priv: N
         Execute_priv: Y
     Create_view_priv: Y
       Show_view_priv: Y
  Create_routine_priv: N
   Alter_routine_priv: N
           Index_priv: Y
     Create_user_priv: Y
           Event_priv: N
         Trigger_priv: Y
     Create_role_priv: Y
       Drop_role_priv: Y
       Account_locked: N
1 row in set (0.00 sec)

upgrade to latest version:

mysql> show grants for t1;
+-----------------------------------------------------------+
| Grants for t1@%                                           |
+-----------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 't1'@'%' WITH GRANT OPTION |
+-----------------------------------------------------------+
1 row in set (0.00 sec)

mysql> show grants for t2;
+--------------------------------+
| Grants for t2@%                |
+--------------------------------+
| GRANT USAGE ON *.* TO 't2'@'%' |
+--------------------------------+
1 row in set (0.00 sec)

mysql> select * from mysql.user where user='t1'\G;
*************************** 1. row ***************************
                 Host: %
                 User: t1
             Password:
          Select_priv: Y
          Insert_priv: Y
          Update_priv: Y
          Delete_priv: Y
          Create_priv: Y
            Drop_priv: Y
         Process_priv: Y
           Grant_priv: Y
      References_priv: Y
           Alter_priv: Y
         Show_db_priv: Y
           Super_priv: Y
Create_tmp_table_priv: Y
     Lock_tables_priv: Y
         Execute_priv: Y
     Create_view_priv: Y
       Show_view_priv: Y
  Create_routine_priv: Y
   Alter_routine_priv: Y
           Index_priv: Y
     Create_user_priv: Y
           Event_priv: Y
         Trigger_priv: Y
     Create_role_priv: Y
       Drop_role_priv: Y
       Account_locked: N
        Shutdown_priv: Y
1 row in set (0.01 sec)

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 the status/LGT1 Indicates that a PR has LGTM 1. label Dec 23, 2019
@imtbkcat
Copy link
Author

/run-all-tests

Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

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

LGTM

@jackysp
Copy link
Member

jackysp commented Dec 23, 2019

/merge

@sre-bot sre-bot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 23, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Dec 23, 2019

Your auto merge job has been accepted, waiting for 14073

@sre-bot
Copy link
Contributor

sre-bot commented Dec 23, 2019

/run-all-tests

@sre-bot sre-bot merged commit 55a6b73 into pingcap:release-3.0 Dec 23, 2019
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/LGT1 Indicates that a PR has LGTM 1. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants