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

Cross join get runtime error: index out of range #14027

Closed
benmaoer opened this issue Dec 11, 2019 · 2 comments · Fixed by #14056
Closed

Cross join get runtime error: index out of range #14027

benmaoer opened this issue Dec 11, 2019 · 2 comments · Fixed by #14056
Assignees
Labels
type/bug The issue is confirmed as a bug.

Comments

@benmaoer
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    create test table, fill it, execute cross join
admin@test>show create table sbtest\G
*************************** 1. row ***************************
       Table: sbtest
Create Table: CREATE TABLE `sbtest` (
  `id` bigint(20) DEFAULT NULL,
  `score` varchar(2000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
1 row in set (0.00 sec)

-- fill table:  insert into sbtest select * from sbtest limit 10000;
...

-- execute query
admin@test>select * from sbtest a cross join sbtest b ;
ERROR 1105 (HY000): runtime error: index out of range [583] with length 583
  1. What did you expect to see?
    get result.

  2. What did you see instead?

admin@test>select * from sbtest a cross join sbtest b ;
ERROR 1105 (HY000): runtime error: index out of range [583] with length 583

admin@test>select * from sbtest a cross join sbtest b ;
ERROR 1105 (HY000): runtime error: index out of range [2813] with length 2813

TiDB's log

[2019/12/11 19:55:52.236 +08:00] [WARN] [conn.go:682] ["dispatch error"] [conn=264358] [connInfo="id:264358, addr:10.42.158.6:46938 status:10, collation:utf8_general_ci, user:admin"] [command=Query] [status="inTxn:0, autocommit:1"] [sql="select * from sbtest a cross join sbtest b"] [err="runtime error: index out of range [2813] with length 2813\ngit.luolix.top/pingcap/tidb/executor.(*HashJoinExec).handleJoinWorkerPanic\n\tgit.luolix.top/pingcap/tidb@/executor/join.go:366\ngit.luolix.top/pingcap/tidb/util.WithRecovery.func1\n\tgit.luolix.top/pingcap/tidb@/util/misc.go:73\nruntime.gopanic\n\truntime/panic.go:679\nruntime.goPanicIndex\n\truntime/panic.go:75\ngit.luolix.top/pingcap/tidb/util/chunk.(*List).GetRow\n\tgit.luolix.top/pingcap/tidb@/util/chunk/list.go:133\ngit.luolix.top/pingcap/tidb/executor.(*HashJoinExec).joinMatchedOuterRow2Chunk\n\tgit.luolix.top/pingcap/tidb@/executor/join.go:438\ngit.luolix.top/pingcap/tidb/executor.(*HashJoinExec).join2Chunk\n\tgit.luolix.top/pingcap/tidb@/executor/join.go:491\ngit.luolix.top/pingcap/tidb/executor.(*HashJoinExec).runJoinWorker\n\tgit.luolix.top/pingcap/tidb@/executor/join.go:402\ngit.luolix.top/pingcap/tidb/executor.(*HashJoinExec).fetchOuterAndProbeHashTable.func2\n\tgit.luolix.top/pingcap/tidb@/executor/join.go:349\ngit.luolix.top/pingcap/tidb/util.WithRecovery\n\tgit.luolix.top/pingcap/tidb@/util/misc.go:81\nruntime.goexit\n\truntime/asm_amd64.s:1357"]
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
    TiDB v3.0.5
admin@test>select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v3.0.5
Git Commit Hash: c9000abdc216b6a02efbcc578af8be1f98ba280d
Git Branch: HEAD
UTC Build Time: 2019-10-25 03:25:32
GoVersion: go version go1.13 linux/amd64
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)
@benmaoer benmaoer added the type/bug The issue is confirmed as a bug. label Dec 11, 2019
@zz-jason
Copy link
Member

@fzhedu PTAL

@fzhedu
Copy link
Contributor

fzhedu commented Dec 12, 2019

I cannot reproduce the bug on local platform.
I create the table sbtest and insert 10000 tuples, the query run correctly.
I wonder three problems:

  1. what is the table size of sbtest?
  2. Does the query run correctly if insert into sbtest select * from sbtest limit 10000; is not run?
  3. can you show some paramaters using the following commands:
show variables like "%tidb%concurrency%";
show variables like "%tidb%size%";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants