ERROR 1105 (HY000): privilege check fail (with GRANT OPTION set) #9781
Closed
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
- What did you do?
If possible, provide a recipe for reproducing the error.
user root
:
MySQL [test]> CREATE USER test_test_u1@localhost;
Query OK, 1 row affected (0.009 sec)
MySQL [test]> CREATE DATABASE test_test_db1;
Query OK, 0 rows affected (0.014 sec)
MySQL [test]> CREATE DATABASE test_test_db2;
Query OK, 0 rows affected (0.014 sec)
MySQL [test]> GRANT ALL ON test_test_db1.* TO test_test_u1@localhost WITH GRANT OPTION;
Query OK, 0 rows affected (0.010 sec)
MySQL [test]> CREATE USER test_test_u2@localhost;
Query OK, 1 row affected (0.007 sec)
MySQL [test]> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MySQL [mysql]> select db;
ERROR 1054 (42S22): Unknown column 'db' in 'field list'
MySQL [mysql]> select * from db;
+-----------+---------------+--------------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+------------------+----------------+---------------------+--------------------+--------------+------------+--------------+
| Host | DB | User | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Create_tmp_table_priv | Lock_tables_priv | Create_view_priv | Show_view_priv | Create_routine_priv | Alter_routine_priv | Execute_priv | Event_priv | Trigger_priv |
+-----------+---------------+--------------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+------------------+----------------+---------------------+--------------------+--------------+------------+--------------+
| localhost | test_test_db1 | test_test_u1 | Y | Y | Y | Y | Y | Y | Y | N | Y | Y | N | N | Y | Y | N | N | Y | N | N |
+-----------+---------------+--------------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+------------------+----------------+---------------------+--------------------+--------------+------------+--------------+
2 rows in set (0.002 sec)
MySQL [mysql]>
user test_test_u1
MySQL [(none)]> use test_test_db1
Database changed
MySQL [test_test_db1]> GRANT SELECT ON v1 TO test_test_u2@localhost;
ERROR 1105 (HY000): privilege check fail
MySQL [test_test_db1]> GRANT SELECT ON t2 TO test_test_u2@localhost;
ERROR 1105 (HY000): privilege check fail
MySQL [test_test_db1]>
- What version of TiDB are you using (
tidb-server -V
or runselect tidb_version();
on TiDB)?
Server version: 5.7.25-TiDB-v3.0.0-beta-231-g20463d6da-dirty