Skip to content

information_schema.columns returns all columns when where clauses are always false #57345

@BrianLiu955

Description

@BrianLiu955

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

mysql> select * from information_schema.columns where table_name ='a';
Empty set (0.00 sec)

mysql> select * from information_schema.columns where table_name ='b';
Empty set (0.01 sec)

mysql> select count() from information_schema.columns where table_name ='b' and table_name ='a';
+----------+
| count(
) |
+----------+
| 4861 |
+----------+
1 row in set (0.01 sec)
mysql> select count() from information_schema.columns;
+----------+
| count(
) |
+----------+
| 4861 |
+----------+
1 row in set (0.02 sec)

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

Empty set

3. What did you see instead (Required)

mysql> select count() from information_schema.columns where table_name ='b' and table_name ='a';
+----------+
| count(
) |
+----------+
| 4861 |
+----------+
1 row in set (0.01 sec)

4. What is your TiDB version? (Required)

v6.1.7, 6.5.11, v7.1.5, v7.5.4, v8.1.1

Metadata

Metadata

Assignees

Labels

affects-6.1This bug affects the 6.1.x(LTS) versions.affects-6.5This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.component/ddlThis issue is related to DDL of TiDB.severity/majortype/bugThe issue is confirmed as a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions