Skip to content

tidb panic:index out of range [10] with length 10 #47521

@jebter

Description

@jebter

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

[conn.go:967] ["connection running loop panic"] [conn=931145388] [session_alias=] [lastSQL="select col1, col2 from pk_multi_col_6005 where col1 = 0xe5ae9f and col2 in (0xf77448cdc3b20bc62cf3, 0x2c9128c1ca1674c39787, 0x5dd8b68d57296bef7480)"] [err="runtime error: index out of range [10] with length 10"] [stack="github.com/pingcap/tidb/server.(*clientConn).Run.func1
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/conn.go:970
runtime.gopanic
\t/usr/local/go/src/runtime/panic.go:914
github.com/pingcap/tidb/executor.(*Compiler).Compile.func1
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/executor/compiler.go:54
runtime.gopanic
\t/usr/local/go/src/runtime/panic.go:914
runtime.goPanicIndex
\t/usr/local/go/src/runtime/panic.go:114
github.com/pingcap/tidb/util/collate.decodeRune
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/util/collate/collate.go:297
github.com/pingcap/tidb/util/collate.(*generalCICollator).Compare
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/util/collate/general_ci.go:31
github.com/pingcap/tidb/types.(*Datum).compareString
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/types/datum.go:766
github.com/pingcap/tidb/types.(*Datum).Compare
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/types/datum.go:668
github.com/pingcap/tidb/planner/cardinality.getOrdinalOfRangeCond
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/cardinality/row_count_index.go:518
github.com/pingcap/tidb/planner/cardinality.getIndexRowCountForStatsV2
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/cardinality/row_count_index.go:283
github.com/pingcap/tidb/planner/cardinality.GetRowCountByIndexRanges
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/cardinality/row_count_index.go:86
github.com/pingcap/tidb/planner/core.(*DataSource).detachCondAndBuildRangeForPath
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/logical_plans.go:1681
github.com/pingcap/tidb/planner/core.(*DataSource).deriveCommonHandleTablePathStats
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/logical_plans.go:1693
github.com/pingcap/tidb/planner/core.(*DataSource).deriveTablePathStats
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/logical_plans.go:1731
github.com/pingcap/tidb/planner/core.(*DataSource).derivePathStatsAndTryHeuristics
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/stats.go:313
github.com/pingcap/tidb/planner/core.(*DataSource).DeriveStats
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/stats.go:462
github.com/pingcap/tidb/planner/core.(*baseLogicalPlan).recursiveDeriveStats
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/stats.go:139
github.com/pingcap/tidb/planner/core.(*baseLogicalPlan).recursiveDeriveStats
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/stats.go:132
github.com/pingcap/tidb/planner/core.physicalOptimize
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/optimizer.go:1155
github.com/pingcap/tidb/planner/core.DoOptimizeAndLogicAsRet
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/optimizer.go:317
github.com/pingcap/tidb/planner/core.DoOptimize
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/optimizer.go:342
github.com/pingcap/tidb/planner.optimize
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/optimize.go:525
github.com/pingcap/tidb/planner.Optimize
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/optimize.go:348
github.com/pingcap/tidb/executor.(*Compiler).Compile
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/executor/compiler.go:98
github.com/pingcap/tidb/session.(*session).ExecuteStmt
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/session/session.go:2212
github.com/pingcap/tidb/server.(*TiDBContext).ExecuteStmt
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/driver_tidb.go:292
github.com/pingcap/tidb/server.(*clientConn).handleStmt
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/conn.go:2011
github.com/pingcap/tidb/server.(*clientConn).handleQuery
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/conn.go:1802
github.com/pingcap/tidb/server.(*clientConn).dispatch
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/conn.go:1289
github.com/pingcap/tidb/server.(*clientConn).Run
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/conn.go:1068
github.com/pingcap/tidb/server.(*Server).onConn
\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/server.go:700\

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

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

v7.4.0

Metadata

Metadata

Assignees

Labels

affects-7.5This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.affects-8.5This bug affects the 8.5.x(LTS) versions.report/customerCustomers have encountered this bug.severity/majorsig/sql-infraSIG: SQL Infratype/bugThe issue is confirmed as a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions