-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Closed
Labels
affects-4.0This bug affects 4.0.x versions.This bug affects 4.0.x versions.affects-5.0This bug affects 5.0.x versions.This bug affects 5.0.x versions.affects-5.1This bug affects 5.1.x versions.This bug affects 5.1.x versions.affects-5.2This bug affects 5.2.x versions.This bug affects 5.2.x versions.affects-5.3This bug affects 5.3.x versions.This bug affects 5.3.x versions.affects-5.4This bug affects the 5.4.x(LTS) versions.This bug affects the 5.4.x(LTS) versions.affects-6.0affects-6.1This bug affects the 6.1.x(LTS) versions.This bug affects the 6.1.x(LTS) versions.affects-6.2affects-6.3severity/minorsig/sql-infraSIG: SQL InfraSIG: SQL Infratype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Description
Bug Report
Thanks for watching the issue. I find the Grantor column in mysql.tables_priv is always NULL although in case of MySQL it has a value. Is it expected behavior?
1. Minimal reproduce step (Required)
CREATE USER test;
GRANT SELECT ON `mysql`.`db` TO test;
SELECT * FROM `mysql`.`tables_priv`;
2. What did you expect to see? (Required)
Grantor column have the grantor name for example root@localhost.
MySQL [(none)]> SELECT * FROM `mysql`.`tables_priv`;
+------+-------+------+------------+---------+---------------------+------------+-------------+
| Host | DB | User | Table_name | Grantor | Timestamp | Table_priv | Column_priv |
+------+-------+------+------------+---------+---------------------+------------+-------------+
| % | mysql | test | db | ******* | 2022-10-04 11:20:37 | Select | Select |
+------+-------+------+------------+---------+---------------------+------------+-------------+
1 row in set (0.02 sec)
Note that the results of MySQL 5.7.39 is the following.
mysql> SELECT * FROM `mysql`.`tables_priv`;
+-----------+-------+---------------+------------+----------------------+---------------------+------------+-------------+
| Host | Db | User | Table_name | Grantor | Timestamp | Table_priv | Column_priv |
+-----------+-------+---------------+------------+----------------------+---------------------+------------+-------------+
| localhost | mysql | mysql.session | user | boot@connecting host | 0000-00-00 00:00:00 | Select | |
| localhost | sys | mysql.sys | sys_config | root@localhost | 2022-10-04 02:43:35 | Select | |
| % | mysql | test | db | root@localhost | 0000-00-00 00:00:00 | Select | |
+-----------+-------+---------------+------------+----------------------+---------------------+------------+-------------+
3 rows in set (0.00 sec)
3. What did you see instead (Required)
The value of Grantor column is NULL.
MySQL [(none)]> SELECT * FROM `mysql`.`tables_priv`;
+------+-------+------+------------+---------+---------------------+------------+-------------+
| Host | DB | User | Table_name | Grantor | Timestamp | Table_priv | Column_priv |
+------+-------+------+------------+---------+---------------------+------------+-------------+
| % | mysql | test | db | | 2022-10-04 11:20:37 | Select | Select |
+------+-------+------+------------+---------+---------------------+------------+-------------+
1 row in set (0.02 sec)
4. What is your TiDB version? (Required)
MySQL [(none)]> select tidb_version();
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v6.1.1
Edition: Community
Git Commit Hash: 5263a0abda61f102122735049fd0dfadc7b7f8b2
Git Branch: heads/refs/tags/v6.1.1
UTC Build Time: 2022-08-25 10:42:41
GoVersion: go1.18.5
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
affects-4.0This bug affects 4.0.x versions.This bug affects 4.0.x versions.affects-5.0This bug affects 5.0.x versions.This bug affects 5.0.x versions.affects-5.1This bug affects 5.1.x versions.This bug affects 5.1.x versions.affects-5.2This bug affects 5.2.x versions.This bug affects 5.2.x versions.affects-5.3This bug affects 5.3.x versions.This bug affects 5.3.x versions.affects-5.4This bug affects the 5.4.x(LTS) versions.This bug affects the 5.4.x(LTS) versions.affects-6.0affects-6.1This bug affects the 6.1.x(LTS) versions.This bug affects the 6.1.x(LTS) versions.affects-6.2affects-6.3severity/minorsig/sql-infraSIG: SQL InfraSIG: SQL Infratype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.