【概述】执行analyze table 报错
【现象】报错无法执行
【TiDB 版本】 V4.0.8
已经执行过重启组件
tiup cluster restart xxxxxxxx-R tikv
tiup cluster restart xxxxxxxx-R tidb
报错依旧
[2021/10/28 11:45:54.247 +08:00] [ERROR] [conn.go:717] ["connection running loop panic"] [conn=319] [lastSQL="ANALYZE table xxxxxx"] [err="runtime error: invalid memory address or nil pointer dereference"] [stack="goroutine 331391 [running]:\
github.com/pingcap/tidb/server.(*clientConn).Run.func1(0x3778a60, 0xc0217571d0, 0xc01af791d0)\
\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/server/conn.go:715 +0xee\
panic(0x2e82400, 0x4d78fb0)\
\t/usr/local/go/src/runtime/panic.go:679 +0x1b2\
github.com/pingcap/tidb/executor.(*ExecStmt).Exec.func1(0xc013b84840, 0xc027b5a7a8, 0xc027b5a788)\
\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/executor/adapter.go:288 +0x54b\
panic(0x2e82400, 0x4d78fb0)\
\t/usr/local/go/src/runtime/panic.go:679 +0x1b2\
github.com/pingcap/tidb/statistics.(*HistColl).getEqualCondSelectivity(0xc027adc500, 0xc002e465a0, 0xc027aa42a0, 0x1b, 0x1b, 0x3, 0x3)\
\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/statistics/table.go:434 +0x1e3\
github.com/pingcap/tidb/statistics.(*HistColl).getIndexRowCount(0xc027adc500, 0xc02726d340, 0x1, 0xc020e9a230, 0x1, 0x1, 0x4, 0x3, 0xc05658eae0)\
\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/statistics/table.go:472 +0xa82\
github.com/pingcap/tidb/statistics.(*HistColl).GetRowCountByIndexRanges(0xc027adc500, 0xc02726d340, 0x1, 0xc020e9a230, 0x1, 0x1, 0x4, 0x4, 0xc027aa4260)\
\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/statistics/table.go:279 +0x2b5\
github.com/pingcap/tidb/planner/core.(*DataSource).fillIndexPath(0xc01807fc00, 0xc026587d40, 0xc027adc4c0, 0x3, 0x4, 0x37ec840, 0xc027a30fa0)\
\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/planner/core/logical_plans.go:762 +0x631\
github.com/pingcap/tidb/planner/core.(*DataSource).DeriveStats(0xc01807fc00, 0x52c28c8, 0x0, 0x0, 0xc027a1b9b0, 0x52c28c8, 0x0, 0x0, 0x7fabda555b28, 0x0, ...)\
\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/planner/core/stats.go:189 +0xce\
github.com/pingcap/tidb/planner/core.(*baseLogicalPlan).recursiveDeriveStats(0xc01807fc20, 0x0, 0x0, 0x0)\
\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/planner/core/stats.go:104 +0x230\
github.com/pingcap/tidb/planner/core.(*baseLogicalPlan).recursiveDeriveStats(0xc027a85200, 0x0, 0x0, 0x0)\
\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/planner/core/stats.go:97 +0x10e\
github.com/pingcap/tidb/planner/core.physicalOptimize(0x37bb8a0, 0xc027a851e0, 0x2082, 0x37bb8a0, 0xc027a851e0, 0x37bb8a0, 0xc027a851e0)\
\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/planner/core/optimizer.go:173 +0x38\
github.com/pingcap/tidb/planner/core.DoOptimize(0x37789e0, 0xc000054078, 0x37bcaa0, 0xc002213e60, 0x82, 0x37bb8a0, 0xc027a851e0, 0x4, 0x37bcaa0, 0xc002213e60, ...)\
\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/planner/core/optimizer.go:135 +0xc0\
github.com/pingcap/tidb/planner/core.(*PlanBuilder).buildDelete(0xc026587b00, 0x37789e0, 0xc000054078, 0xc0273a1b90, 0x0, 0x0, 0x0, 0x0)\
\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/planner/core/logical_plan_builder.go:3695 +0x614\
github.com/pingcap/tidb/planner/core.(*PlanBuilder).Build(0xc026587b00, 0x37789e0, 0xc000054078, 0x3779660, 0xc0273a1b90, 0xc026587b00, 0xc0244c0600, 0xc0267e1512, 0xd)\
\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/planner/core/planbuilder.go:564 +0x7b4\
github.com/pingcap/tidb/planner.optimize(0x37789e0, 0xc000054078, 0x37bcaa0, 0xc002213e60, 0x3779660, 0xc0273a1b90, 0x37b21c0, 0xc001bf49c0, 0x0, 0x0, ...)\
\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/planner/optimize.go:208 +0x1e9\
github.com/pingcap/tidb/planner.Optimize(0x37789e0, 0xc000054078, 0x37bcaa0, 0xc002213e60, 0x3779660, 0xc0273a1b90, 0x37b21c0, 0xc001bf49c0, 0x0, 0x0, ...)\
\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/planner/optimize.go:107 +0x352\
github.com/pingcap/tidb/executor.(*Compiler).Compile(0xc027b594f0, 0x37789e0, 0xc000054078, 0x3781220, 0xc0273a1b90, 0x0, 0x0, 0x0)\
\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/executor/compiler.go:62 +0x294\
githu"]