Closed zyguan closed 4 years ago
This can be reproduced on TiKV.
If we test this on mocktikv, we'll get an index out of range
error:
[2020/08/26 15:46:20.698 +08:00] [ERROR] [conn.go:730] ["command dispatched failed"] [conn=1] [connInfo="id:1, addr:127.0.0.1:51468 status:10, collation:utf8_general_ci, user:root"] [command=Query] [status="inTxn:0, autocommit:1"] [sql="select * from t1 where c_decimal in (select c_decimal from t2 where t1.c_int = t2.c_int or t1.c_int = t2.c_int and t1.c_str > t2.c_str)"] [txn_mode=OPTIMISTIC] [err="runtime error: index out of range [2] with length 2\ngithub.com/pingcap/tidb/store/tikv.(*copIteratorWorker).handleTask.func1\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/store/tikv/coprocessor.go:698\nruntime.gopanic\n\t/Users/xuhuaiyu/.gvm/gos/go1.13/src/runtime/panic.go:679\nruntime.goPanicIndex\n\t/Users/xuhuaiyu/.gvm/gos/go1.13/src/runtime/panic.go:75\ngithub.com/pingcap/tidb/util/rowcodec.(*BytesDecoder).decodeToBytesInternal\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/util/rowcodec/decoder.go:391\ngithub.com/pingcap/tidb/util/rowcodec.(*BytesDecoder).DecodeToBytes\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/util/rowcodec/decoder.go:423\ngithub.com/pingcap/tidb/store/mockstore/mocktikv.getRowData\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/store/mockstore/mocktikv/executor.go:675\ngithub.com/pingcap/tidb/store/mockstore/mocktikv.(*tableScanExec).getRowFromRange\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/store/mockstore/mocktikv/executor.go:244\ngithub.com/pingcap/tidb/store/mockstore/mocktikv.(*tableScanExec).Next\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/store/mockstore/mocktikv/executor.go:166\ngithub.com/pingcap/tidb/store/mockstore/mocktikv.(*selectionExec).Next\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/store/mockstore/mocktikv/executor.go:481\ngithub.com/pingcap/tidb/store/mockstore/mocktikv.(*rpcHandler).handleCopDAGRequest\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/store/mockstore/mocktikv/cop_handler_dag.go:73\ngithub.com/pingcap/tidb/store/mockstore/mocktikv.(*RPCClient).SendRequest\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/store/mockstore/mocktikv/rpc.go:1031\ngithub.com/pingcap/tidb/store/tikv.reqCollapse.SendRequest\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/store/tikv/client_collapse.go:49\ngithub.com/pingcap/tidb/store/tikv.(*RegionRequestSender).sendReqToRegion\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/store/tikv/region_request.go:358\ngithub.com/pingcap/tidb/store/tikv.(*RegionRequestSender).SendReqCtx\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/store/tikv/region_request.go:251\ngithub.com/pingcap/tidb/store/tikv.(*clientHelper).SendReqCtx\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/store/tikv/coprocessor.go:879\ngithub.com/pingcap/tidb/store/tikv.(*copIteratorWorker).handleTaskOnce\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/store/tikv/coprocessor.go:778\ngithub.com/pingcap/tidb/store/tikv.(*copIteratorWorker).handleTask\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/store/tikv/coprocessor.go:708\ngithub.com/pingcap/tidb/store/tikv.(*copIteratorWorker).run\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/store/tikv/coprocessor.go:499\nruntime.goexit\n\t/Users/xuhuaiyu/.gvm/gos/go1.13/src/runtime/asm_amd64.s:1357"]
It should be close after 4.0 is fixed
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
release-4.0 @ 61f1150e45f929fac9b4b82fc475840efd6b43a1