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

IndexMerge cached wrong plan #41828

Closed
ChenPeng2013 opened this issue Mar 1, 2023 · 1 comment · Fixed by #41870
Closed

IndexMerge cached wrong plan #41828

ChenPeng2013 opened this issue Mar 1, 2023 · 1 comment · Fixed by #41870
Assignees
Labels
affects-6.5 This bug affects the 6.5.x(LTS) versions. epic/plan-cache severity/critical sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@ChenPeng2013
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)


drop table IDT_MULTI15840STROBJSTROBJ;
CREATE TABLE `IDT_MULTI15840STROBJSTROBJ` (
  `COL1` enum('aa', 'zzz') DEFAULT NULL,
  `COL2` smallint(6) DEFAULT NULL,
  `COL3` date DEFAULT NULL,
  KEY `U_M_COL4` (`COL1`,`COL2`),
  KEY `U_M_COL5` (`COL3`,`COL2`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
INSERT INTO `IDT_MULTI15840STROBJSTROBJ` VALUES ('zzz',1047,'6115-06-05'),('zzz',-23221,'4250-09-03'),('zzz',27138,'1568-07-30'),('zzz',-30903,'6753-08-21'),('zzz',-26875,'6117-10-10');


prepare stmt from 'select * from IDT_MULTI15840STROBJSTROBJ where col3 <=> ? or col1 in (?, ?, ?) and col2 not between ? and ?;';
set @a="0051-12-23", @b="none", @c="none", @d="none", @e=-32757, @f=-32757;
execute stmt using @a,@b,@c,@d,@e,@f;
set @a="9795-01-10", @b="aa", @c="aa", @d="aa", @e=31928, @f=31928;
execute stmt using @a,@b,@c,@d,@e,@f;

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

MySQL [test]> set @a="9795-01-10", @b="aa", @c="aa", @d="aa", @e=31928, @f=31928;
Query OK, 0 rows affected (0.00 sec)

MySQL [test]> execute stmt using @a,@b,@c,@d,@e,@f;
Empty set (0.00 sec)

3. What did you see instead (Required)

mysql> execute stmt using @a,@b,@c,@d,@e,@f;
+------+--------+------------+
| COL1 | COL2   | COL3       |
+------+--------+------------+
| zzz  |   1047 | 6115-06-05 |
| zzz  | -23221 | 4250-09-03 |
| zzz  |  27138 | 1568-07-30 |
| zzz  | -30903 | 6753-08-21 |
| zzz  | -26875 | 6117-10-10 |
+------+--------+------------+
5 rows in set (0.05 sec)

4. What is your TiDB version? (Required)

Release Version: v6.7.0-alpha-146-g96e345d1b
Edition: Community
Git Commit Hash: 96e345d1b3b88e0fb46d93d5117f666e353c9cf3
Git Branch: master
UTC Build Time: 2023-03-01 01:06:43
GoVersion: go1.19.1
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: unistore
@ChenPeng2013 ChenPeng2013 added type/bug The issue is confirmed as a bug. sig/planner SIG: Planner severity/critical epic/plan-cache labels Mar 1, 2023
@ti-chi-bot ti-chi-bot added may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 labels Mar 1, 2023
@ChenPeng2013 ChenPeng2013 removed may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-6.1 may-affects-6.5 labels Mar 1, 2023
@qw4990 qw4990 self-assigned this Mar 1, 2023
@qw4990
Copy link
Contributor

qw4990 commented Mar 1, 2023

It is introduced by #41723, I'll fix it soon.

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