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

TiDB returns wrong result while comparison between integer and varchar is performed #25600

Open
PragmaTwice opened this issue Jun 21, 2021 · 0 comments
Labels
severity/moderate sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@PragmaTwice
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE a(b char, c varchar(50));
INSERT a VALUES("", "sc");
CREATE TABLE d(e varchar(0));
INSERT d VALUES("");
SELECT * FROM a WHERE c IN(SELECT b UNION SELECT avg(e) FROM d);

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

In MySQL:

+------+------+
| b    | c    |
+------+------+
|      | sc   |
+------+------+
1 row in set (0.00 sec)

3. What did you see instead (Required)

Empty set (0.00 sec)

4. What is your TiDB version? (Required)

+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()
                                                                                                                                                 |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v5.2.0-alpha-88-ged52601e6
Edition: Community
Git Commit Hash: ed52601e6eb560138db8cdccdfa1b5e2d33a11f0
Git Branch: master
UTC Build Time: 2021-06-16 13:03:48
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants