-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
partition table prune cause panic #35832
Comments
Can you provide the panic stack trace? |
[conn.go:801] ["connection running loop panic"] [conn=7238699] [lastSQL="select d, m, sum(v) from t_panic where d = 20220604 group by m"] [err="runtime error: index out of range [3] with length 3"] [stack="goroutine 42165225680 [running]:\ngit.luolix.top/pingcap/tidb/server.(*clientConn).Run.func1(0x3c187d8, 0xc1573e2ab0, 0xc229f94500)\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/conn.go:799 +0xf5\npanic(0x3555700, 0xc1b4609aa0)\n\t/usr/local/go/src/runtime/panic.go:965 +0x1b9\ngit.luolix.top/pingcap/tidb/planner/core.(*partitionProcessor).pruneRangePartition(0x57eb7a0, 0x3c58130, 0xc0af7c6000, 0xc0e1d717c0, 0x3c4c498, 0xc12dca06e0, 0xc1f3271340, 0x1, 0x1, 0xc18e2ff180, ...)\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/rule_partition_processor.go:856 +0xa6f\ngit.luolix.top/pingcap/tidb/planner/core.(*partitionProcessor).processRangePartition(0x57eb7a0, 0xc1e756e000, 0xc0e1d717c0, 0xc03d474a00, 0xc1f3271300, 0x3c806a0, 0xc03d474a00)\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/rule_partition_processor.go:869 +0x12a\ngit.luolix.top/pingcap/tidb/planner/core.(*partitionProcessor).prune(0x57eb7a0, 0xc1e756e000, 0xc257f9fc78, 0x1119465, 0xc1f3271350, 0x0)\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/rule_partition_processor.go:627 +0x2e5\ngit.luolix.top/pingcap/tidb/planner/core.(*partitionProcessor).rewriteDataSource(0x57eb7a0, 0x3c55390, 0xc1e756e000, 0x1, 0xc1e756e000, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/rule_partition_processor.go:65 +0x8a\ngit.luolix.top/pingcap/tidb/planner/core.(*partitionProcessor).rewriteDataSource(0x57eb7a0, 0x3c55490, 0xc0c1338500, 0x1, 0x264dac5, 0xc036f26540, 0xc18e2ffb80)\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/rule_partition_processor.go:93 +0x153\ngit.luolix.top/pingcap/tidb/planner/core.(*partitionProcessor).rewriteDataSource(0x57eb7a0, 0x3c55f90, 0xc23f453420, 0x57ee140, 0x0, 0x34a49c0, 0xc001114930)\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/rule_partition_processor.go:93 +0x153\ngit.luolix.top/pingcap/tidb/planner/core.(*partitionProcessor).optimize(0x57eb7a0, 0x3c187d8, 0xc091e60150, 0x3c55f90, 0xc23f453420, 0x3c55f90, 0xc23f453420, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/rule_partition_processor.go:58 +0x3f\ngit.luolix.top/pingcap/tidb/planner/core.logicalOptimize(0x3c187d8, 0xc091e60150, 0x5dea, 0x3c55f90, 0xc23f453420, 0x324a400900000000, 0x62bd0033, 0xc257fa0408, 0x1161166)\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/optimizer.go:243 +0x11b\ngit.luolix.top/pingcap/tidb/planner/core.DoOptimize(0x3c187d8, 0xc091e60150, 0x3c58130, 0xc0af7c6000, 0x5dea, 0x3c55f90, 0xc23f453420, 0x0, 0x0, 0x0, ...)\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/optimizer.go:152 +0xb8\ngit.luolix.top/pingcap/tidb/planner.optimize(0x3c187d8, 0xc091e60150, 0x3c58130, 0xc0af7c6000, 0x3c2daf8, 0xc25765ca50, 0x3c4eea8, 0xc0a7685540, 0x0, 0x0, ...)\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/optimize.go:288 +0x7ab\ngit.luolix.top/pingcap/tidb/planner.Optimize(0x3c187d8, 0xc091e60150, 0x3c58130, 0xc0af7c6000, 0x3c2daf8, 0xc25765ca50, 0x3c4eea8, 0xc0a7685540, 0x0, 0x0, ...)\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/optimize.go:124 +0x509\ngit.luolix.top/pingcap/tidb/executor.(*Compiler).Compile(0xc038502ce0, 0x3c187d8, 0xc091e60150, 0x3c32d88, 0xc25765ca50, 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/executor/compiler.go:63 +0x30d\ngit.luolix.top/pingcap/tidb/session.(*session).ExecuteStmt(0xc0af7c6000, 0x3c187d8, 0xc091e60150, 0x3c32d88, 0xc25765ca50, 0x0, 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/session/session.go:1510 +0x4c9\ngit.luolix.top/pingcap/tidb/server.(*TiDBContext).ExecuteStmt(0xc4f2cb8b70, 0x3c187d8, 0xc091e60150, 0x3c32d88, 0xc25765ca50, 0xc0d9584220, 0x3c187d8, 0xc091e60150, 0x0)\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/ti"] |
how to fix it ? @chrysan |
@leonirvanel which version is this stack trace from? v5.4.0 or v5.1.4? |
V5.1.4 |
Closing this issue since it's a duplicate bug. Feel free to reopen it if you have further questions. |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
1.1 prepare table
CREATE TABLE
t_panic
(d
int(11) DEFAULT NULL,i
varchar(10) DEFAULT NULL,m
varchar(10) DEFAULT NULL,v
int(11) DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
PARTITION BY RANGE (
d
)(PARTITION
p20220601
VALUES LESS THAN (20220602),PARTITION
p20220602
VALUES LESS THAN (20220603),PARTITION
p20220603
VALUES LESS THAN (20220604));1.2 execute query
select d, m, sum(v) from t_panic where d = 20220604 group by m;
2. What did you expect to see? (Required)
Empty set (0.01 sec)
3. What did you see instead (Required)
ERROR 1105 (HY000): runtime error: index out of range [3] with length 3
4. What is your TiDB version? (Required)
5.7.25-TiDB-v5.4.0
5.7.25-TiDB-v5.1.4
The text was updated successfully, but these errors were encountered: