Skip to content

SHOW TABLE STATUS case sensitivity #7518

@morgo

Description

@morgo

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
MySQL [test]> show tables;
Empty set (0.00 sec)

MySQL [test]> CREATE TABLE t1 (a int);
Query OK, 0 rows affected (0.12 sec)

MySQL [test]> SELECT * FROM T1;
Empty set (0.11 sec)

MySQL [test]> SHOW TABLE STATUS like 't1';
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+-----------------------------------+---------------------+---------------------+-----------------+----------+----------------+---------+
| Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time                       | Update_time         | Check_time          | Collation       | Checksum | Create_options | Comment |
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+-----------------------------------+---------------------+---------------------+-----------------+----------+----------------+---------+
| t1   | InnoDB |      10 | Compact    |  100 |            100 |         100 |             100 |          100 |       100 |            100 | 2018-08-28 14:31:40.165 +0000 UTC | 2018-08-28 14:32:04 | 2018-08-28 14:32:04 | utf8_general_ci |          |                |         |
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+-----------------------------------+---------------------+---------------------+-----------------+----------+----------------+---------+
1 row in set (0.00 sec)

MySQL [test]> SHOW TABLE STATUS like 'T1';
Empty set (0.00 sec)

Also:

MySQL [test]> SELECT * FROM information_schema.tables where table_schema='test' and table_name='T1'\G
Empty set (0.02 sec)

This command is however correct:

MySQL [test]> SHOW CREATE TABLE T1;
+-------+------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                         |
+-------+------------------------------------------------------------------------------------------------------+
| t1    | CREATE TABLE `t1` (
  `a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin |
+-------+------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

(I checked some other commands too: SHOW INDEXES FROM T1 is also correct leading to some inconsistency.)

  1. What did you expect to see?

SHOW TABLE STATUS should be case insensitive / behave the same as the select statement, since TiDB behaves according to lower_case_table_names=2.

  1. What did you see instead?

No result.

  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?

MySQL [test]> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v2.1.0-beta-229-g5404e2e
Git Commit Hash: 5404e2e
Git Branch: master
UTC Build Time: 2018-08-14 01:46:09
GoVersion: go version go1.10.2 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
1 row in set (0.00 sec)

Metadata

Metadata

Assignees

Labels

affects-6.1This bug affects the 6.1.x(LTS) versions.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.severity/minorsig/sql-infraSIG: SQL Infratype/compatibility

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions