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

prepared-plan-cache: return wrong results using "<=>" statement #30100

Closed
ChenPeng2013 opened this issue Nov 24, 2021 · 2 comments · Fixed by #30003
Closed

prepared-plan-cache: return wrong results using "<=>" statement #30100

ChenPeng2013 opened this issue Nov 24, 2021 · 2 comments · Fixed by #30003
Assignees
Labels
affects-5.3 This bug affects 5.3.x versions. epic/plan-cache severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@ChenPeng2013
Copy link
Contributor

ChenPeng2013 commented Nov 24, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

prepared-plan-cache.enabled=true

use test;
drop table if exists t;
create table t(col1 enum("aa", "bb"), col2 int, index(col1, col2));
insert into t values("aa", 333);
prepare stmt from 'SELECT * FROM t t1 JOIN t t2 ON t1.col1 = t2.col1 WHERE t1.col1 <=> NULL';
execute stmt;
execute stmt;

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

mysql> execute stmt;
Empty set (0.01 sec)

3. What did you see instead (Required)

mysql> execute stmt;
+------+------+------+------+
| col1 | col2 | col1 | col2 |
+------+------+------+------+
| aa   |  333 | aa   |  333 |
+------+------+------+------+
1 row in set (0.01 sec)

4. What is your TiDB version? (Required)

Release Version: v5.4.0-alpha-217-gf45a8f051
Edition: Community
Git Commit Hash: f45a8f0511156855d2c109d216acdd1f900abe20
Git Branch: master
UTC Build Time: 2021-11-24 06:52:38
GoVersion: go1.16.5
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
@ChenPeng2013 ChenPeng2013 added type/bug The issue is confirmed as a bug. sig/planner SIG: Planner severity/major epic/plan-cache affects-5.3 This bug affects 5.3.x versions. labels Nov 24, 2021
@Reminiscent Reminiscent self-assigned this Nov 24, 2021
@Reminiscent
Copy link
Contributor

#30003 can solve this problem. And I will add more test cases.

@github-actions
Copy link

Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.3 This bug affects 5.3.x versions. epic/plan-cache severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants