-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
severity/moderatesig/sql-infraSIG: SQL InfraSIG: SQL Infratype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
mysql -h127.1 -uroot -P4000
mysql> create database tmpdb;
Query OK, 0 rows affected (0.01 sec)
mysql> create table tmpdb.t(id int);
Query OK, 0 rows affected (0.01 sec)
mysql> drop user test_user;
Query OK, 0 rows affected (0.01 sec)
mysql> create user test_user;
Query OK, 0 rows affected (0.01 sec)
mysql> grant create temporary tables on tmpdb.* to test_user;
Query OK, 0 rows affected (0.00 sec)
mysql -h127.1 -utest_user -P4000
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| INFORMATION_SCHEMA |
| tmpdb |
+--------------------+
2 rows in set (0.00 sec)
mysql> use tmpdb;
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> show tables;
+-----------------+
| Tables_in_tmpdb |
+-----------------+
| t |
+-----------------+
1 row in set (0.00 sec)
mysql> show create table t;
+-------+------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+------------------------------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)
2. What did you expect to see? (Required)
mysql -h127.1 -utest_user -Ac
mysql> use tmpdb;
Database changed
mysql> show tables;
Empty set (0.01 sec)
mysql> show create table t;
ERROR 1142 (42000): SHOW command denied to user 'test_user'@'localhost' for table 't'
3. What did you see instead (Required)
mysql -h127.1 -utest_user -P4000
mysql> use tmpdb;
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> show tables;
+-----------------+
| Tables_in_tmpdb |
+-----------------+
| t |
+-----------------+
1 row in set (0.00 sec)
mysql> show create table t;
+-------+------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+------------------------------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)
4. What is your TiDB version? (Required)
master
Metadata
Metadata
Assignees
Labels
severity/moderatesig/sql-infraSIG: SQL InfraSIG: SQL Infratype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.