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

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
@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
@tangenta tangenta self-assigned this 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants