query use prefix index and hint INL_JOIN,occur error: index out of range #24717
Labels
affects-4.0
This bug affects 4.0.x versions.
affects-5.0
This bug affects 5.0.x versions.
severity/major
sig/execution
SIG execution
type/bug
The issue is confirmed as a bug.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
CREATE TABLE
t1
(c_int
int(11),c_str
varchar(40), KEYc_str
(c_str
(8)) );CREATE TABLE
t2
(c_int
int(11),c_str
varchar(40), KEYc_str
(c_str
(8)) );insert into t1 values(1,'optimistic villani');
insert into t2 values(1,'fervent dubinsky');
select /*+ INL_JOIN(t1,t2) */ * from t1 right join t2 on t1.c_str = t2.c_str;
2. What did you expect to see? (Required)
query return sucessful
3. What did you see instead (Required)
query return error
mysql> select /*+ INL_JOIN(t1,t2) */ * from t1 right join t2 on t1.c_str = t2.c_str;
ERROR 1105 (HY000): runtime error: index out of range [1] with length 1
log:
[2021/05/18 07:30:55.873 +00:00] [ERROR] [index_lookup_join.go:452] ["innerWorker panicked"] [conn=23] [stack="goroutine 133912 [running]:\ngithub.com/pingcap/tidb/executor.(*innerWorker).run.func1(0x4005480, 0xc001443300, 0xc000b86f38, 0xc0021b6a90)\n\t/home/jenkins/agent/workspace/ld_tidb_multi_branch_release-5.0/go/src/github.com/pingcap/tidb/executor/index_lookup_join.go:450 +0xd3\npanic(0x379a660, 0xc0016ff3c0)\n\t/usr/local/go/src/runtime/panic.go:679 +0x1b2\ngithub.com/pingcap/tidb/executor.(*innerWorker).constructLookupContent(0xc0021eb400, 0xc0014ff480, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/ld_tidb_multi_branch_release-5.0/go/src/github.com/pingcap/tidb/executor/index_lookup_join.go:540 +0x977\ngithub.com/pingcap/tidb/executor.(*innerWorker).handleTask(0xc0021eb400, 0x4005480, 0xc001443300, 0xc0014ff480, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/ld_tidb_multi_branch_release-5.0/go/src/github.com/pingcap/tidb/executor/index_lookup_join.go:487 +0x66\ngithub.com/pingcap/tidb/executor.(*innerWorker).run(0xc0021eb400, 0x4005480, 0xc001443300, 0xc0021b6a90)\n\t/home/jenkins/agent/workspace/ld_tidb_multi_branch_release-5.0/go/src/github.com/pingcap/tidb/executor/index_lookup_join.go:469 +0x155\ncreated by github.com/pingcap/tidb/executor.(IndexLookUpJoin).startWorkers\n\t/home/jenkins/agent/workspace/ld_tidb_multi_branch_release-5.0/go/src/github.com/pingcap/tidb/executor/index_lookup_join.go:182 +0x1fe\n"]
[2021/05/18 07:30:55.874 +00:00] [INFO] [conn.go:812] ["command dispatched failed"] [conn=23] [connInfo="id:23, addr:127.0.0.1:51006 status:10, collation:utf8_general_ci, user:root"] [command=Query] [status="inTxn:0, autocommit:1"] [sql="select /+ INL_JOIN(t1,t2) */ * from t1 right join t2 on t1.c_str = t2.c_str"] [txn_mode=PESSIMISTIC] [err="runtime error: index out of range [1] with length 1\ngithub.com/pingcap/tidb/executor.(*innerWorker).run.func1\n\t/home/jenkins/agent/workspace/ld_tidb_multi_branch_release-5.0/go/src/github.com/pingcap/tidb/executor/index_lookup_join.go:454\nruntime.gopanic\n\t/usr/local/go/src/runtime/panic.go:679\nruntime.goPanicIndex\n\t/usr/local/go/src/runtime/panic.go:75\ngithub.com/pingcap/tidb/executor.(*innerWorker).constructLookupContent\n\t/home/jenkins/agent/workspace/ld_tidb_multi_branch_release-5.0/go/src/github.com/pingcap/tidb/executor/index_lookup_join.go:540\ngithub.com/pingcap/tidb/executor.(*innerWorker).handleTask\n\t/home/jenkins/agent/workspace/ld_tidb_multi_branch_release-5.0/go/src/github.com/pingcap/tidb/executor/index_lookup_join.go:487\ngithub.com/pingcap/tidb/executor.(*innerWorker).run\n\t/home/jenkins/agent/workspace/ld_tidb_multi_branch_release-5.0/go/src/github.com/pingcap/tidb/executor/index_lookup_join.go:469\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1357"]
4. What is your TiDB version? (Required)
Release Version: v5.0.1-3-g41c0f1762
Edition: Community
Git Commit Hash: 41c0f17
Git Branch: release-5.0
UTC Build Time: 2021-05-13 17:21:10
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
The text was updated successfully, but these errors were encountered: