Skip to content

still see column privileges after drop user #35059

@D3Hunter

Description

@D3Hunter

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create database db2;
create table db2.t1(id int, val varchar(100));
insert into db2.t1 values(1, 'a'), (2, 'b');
create table db2.t2(id int, val varchar(100));
insert into db2.t2 values(1, 'a'), (2, 'b');

create user user1 identified by '123456';
grant select(val), update(val) on db2.t2 to user1;
mysql> show grants for user1;
+---------------------------------------------------------+
| Grants for user1@%                                      |
+---------------------------------------------------------+
| GRANT USAGE ON *.* TO 'user1'@'%'                       |
| GRANT SELECT(val), UPDATE(val) ON db2.t2 TO 'user1'@'%' |
+---------------------------------------------------------+

mysql> drop user user1;
Query OK, 0 rows affected (0.02 sec)

mysql> show grants for user1;
+---------------------------------------------------------+
| Grants for user1@%                                      |
+---------------------------------------------------------+
| GRANT SELECT(val), UPDATE(val) ON db2.t2 TO 'user1'@'%' |
+---------------------------------------------------------+
1 row in set (0.00 sec)

2. What did you expect to see? (Required)

empty grants for a dropped user

3. What did you see instead (Required)

still can see column privileges

4. What is your TiDB version? (Required)

mysql> select tidb_version()\G;
*************************** 1. row ***************************
tidb_version(): Release Version: v5.4.0
Edition: Community
Git Commit Hash: 55f3b24c1c9f506bd652ef1d162283541e428872
Git Branch: heads/refs/tags/v5.4.0
UTC Build Time: 2022-01-25 08:41:03
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions