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: index out of range [0] with length 0 #29993

Closed
ChenPeng2013 opened this issue Nov 22, 2021 · 1 comment · Fixed by #30003
Closed

prepared-plan-cache: index out of range [0] with length 0 #29993

ChenPeng2013 opened this issue Nov 22, 2021 · 1 comment · 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

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 UK_COLLATION13389STROBJSTROBJ;
CREATE TABLE `UK_COLLATION13389STROBJSTROBJ` (
  `COL1` enum('aa','bb') COLLATE utf8_general_ci DEFAULT NULL,
  `COL2` varchar(20) COLLATE utf8_general_ci DEFAULT NULL,
  `COL4` datetime DEFAULT NULL,
  `COL3` bigint(20) DEFAULT NULL,
  `COL5` float DEFAULT NULL,
  UNIQUE KEY `U_COL1` (`COL1`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
insert into UK_COLLATION13389STROBJSTROBJ values("aa", "鞄鎍櫑兎歱独鴯搄挙裎壧夌藍譺这娨慳彌瓲廀", "6274-10-31 20:26:03", -5680221277985353573, -1.52993e38);
prepare stmt from 'select * from UK_COLLATION13389STROBJSTROBJ where col1 = ? and col2 = ? and col3 not in (?, ?, ?);';
set @a="aa", @b="鞄鎍櫑兎歱独鴯搄挙裎壧夌藍譺这娨慳彌瓲廀", @c=8974343214523908157, @d=8974343214523908157, @e=8974343214523908157;
execute stmt using @a,@b,@c,@d,@e;
set @a="none", @b="zxHuU2UgakSnY3wp", @c=-655854024836656433, @d=2241491591785470002, @e=-3806929031203206071;
execute stmt using @a,@b,@c,@d,@e;

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

mysql> execute stmt using @a,@b,@c,@d,@e;
Empty set (0.00 sec)

3. What did you see instead (Required)

mysql> execute stmt using @a,@b,@c,@d,@e;
ERROR 1105 (HY000): runtime error: index out of range [0] with length 0

4. What is your TiDB version? (Required)

Release Version: v5.4.0-alpha-165-g47f8aad12
Edition: Community
Git Commit Hash: 47f8aad12dfcf57031116b95f28392ebac80f985
Git Branch: master
UTC Build Time: 2021-11-22 03:00:57
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 labels Nov 22, 2021
@Reminiscent Reminiscent self-assigned this Nov 22, 2021
@ChenPeng2013 ChenPeng2013 added the affects-5.3 This bug affects 5.3.x versions. label Nov 22, 2021
@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