Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
BrianLiu955 opened this issue Nov 13, 2024 · 0 comments · Fixed by #57370
Closed
Assignees
Labels
affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. component/ddl This issue is related to DDL of TiDB. severity/major type/bug The issue is confirmed as a bug.

Comments

@BrianLiu955
Copy link

BrianLiu955 commented Nov 13, 2024

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

@BrianLiu955 BrianLiu955 added the type/bug The issue is confirmed as a bug. label Nov 13, 2024
@ti-chi-bot ti-chi-bot bot added affects-8.1 This bug affects the 8.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. labels Nov 13, 2024
@BrianLiu955 BrianLiu955 changed the title The following SQL displays all the results of the columns table, which does not meet expectations: "select* from information_schema.columns where table_name ='b' and table_name ='a'; " information_schema.columns returns all columns when where clauses are always false Nov 13, 2024
@ti-chi-bot ti-chi-bot bot added affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. labels Nov 13, 2024
@tangenta tangenta self-assigned this Nov 13, 2024
@Benjamin2037 Benjamin2037 added affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. and removed affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. labels Nov 13, 2024
@ti-chi-bot ti-chi-bot bot added may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-8.5 labels Nov 14, 2024
@tangenta tangenta removed may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-8.5 labels Nov 14, 2024
@ti-chi-bot ti-chi-bot bot closed this as completed in f27b3c2 Nov 14, 2024
@jebter jebter added the component/ddl This issue is related to DDL of TiDB. label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. component/ddl This issue is related to DDL of TiDB. severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants