Skip to content

information_schema.tables return wrong result #56377

@tangenta

Description

@tangenta

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

use test;
drop table if exists caseSensitive;
drop table if exists unrelatedTable;

create table caseSensitive (a int);
create table unrelatedTable (a int);
select table_schema, table_name from information_schema.tables where table_schema = 'test' and table_name like '%aseSensitive';
select table_schema, table_name, tidb_pk_type from information_schema.tables where table_schema = 'test' and table_name like '%aseSensitive';

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

mysql> select table_schema, table_name from information_schema.tables where table_schema = 'test' and table_name like '%aseSensitive';
+--------------+---------------+
| table_schema | table_name    |
+--------------+---------------+
| test         | caseSensitive |
+--------------+---------------+
1 row in set (0.00 sec)

mysql> select table_schema, table_name, tidb_pk_type from information_schema.tables where table_schema = 'test' and table_name like '%aseSensitive';
+--------------+---------------+--------------+
| table_schema | table_name    | tidb_pk_type |
+--------------+---------------+--------------+
| test         | caseSensitive | NONCLUSTERED |
+--------------+---------------+--------------+
1 row in set (0.00 sec)

3. What did you see instead (Required)

mysql> select table_schema, table_name from information_schema.tables where table_schema = 'test' and table_name like '%aseSensitive';
+--------------+----------------+
| table_schema | table_name     |
+--------------+----------------+
| test         | unrelatedTable |
| test         | caseSensitive  |
+--------------+----------------+
2 rows in set (0.00 sec)

mysql> select table_schema, table_name, tidb_pk_type from information_schema.tables where table_schema = 'test' and table_name like '%aseSensitive';
Empty set (0.00 sec)

4. What is your TiDB version? (Required)

b520f61

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions