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

query use prefix index and hint INL_JOIN,occur error: index out of range #24717

Closed
vivid392845427 opened this issue May 18, 2021 · 1 comment · Fixed by #24568
Closed

query use prefix index and hint INL_JOIN,occur error: index out of range #24717

vivid392845427 opened this issue May 18, 2021 · 1 comment · Fixed by #24568
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.

Comments

@vivid392845427
Copy link

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), KEY c_str (c_str(8)) );
CREATE TABLE t2 ( c_int int(11),c_str varchar(40), KEY c_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

@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants