Please answer these questions before submitting your issue. Thanks!
desc table t;
[ERROR] [conn.go:733] ["connection running loop panic"] [conn=3] [lastSQL="desc table t1"] [err="runtime error: slice bounds out of range [-1:]"] [stack="goroutine 616 [running]:\ngithub.com/pingcap/tidb/server.(*clientConn).Run.func1(0x6aae200, 0xc000f65860, 0xc000137100)\n\t/Users/fzh/go/src/github.com/pingcap/tidb/server/conn.go:731 +0xee\npanic(0x6296300, 0xc000d52680)\n\t/usr/local/Cellar/go/1.14.3/libexec/src/runtime/panic.go:969 +0x166\ngithub.com/pingcap/tidb/planner.extractSelectAndNormalizeDigest(0x6ad1f20, 0xc0010a3ec0, 0xc0005dcfbc, 0x4, 0xc000a1c5a0, 0xc000fc6640, 0xc0010c49c0, 0x6aca9c0, 0xc001038d00, 0xc000fc6640)\n\t/Users/fzh/go/src/github.com/pingcap/tidb/planner/optimize.go:312 +0x84a\ngithub.com/pingcap/tidb/planner.getBindRecord(0x6b00b80, 0xc0009b3300, 0x6ad1f20, 0xc0010a3ec0, 0xc0010a3ec0, 0xc0010a3e01, 0x6af3740)\n\t/Users/fzh/go/src/github.com/pingcap/tidb/planner/optimize.go:358 +0xb7\ngithub.com/pingcap/tidb/planner.Optimize(0x6aae200, 0xc0010c4840, 0x6b00b80, 0xc0009b3300, 0x6ac9580, 0xc0010a3ec0, 0x6af3740, 0xc000c7b830, 0x0, 0x0, ...)\n\t/Users/fzh/go/src/github.com/pingcap/tidb/planner/optimize.go:134 +0x571\ngithub.com/pingcap/tidb/executor.(*Compiler).Compile(0xc000fc6dd8, 0x6aae200, 0xc0010c4840, 0x6ad1f20, 0xc0010a3ec0, 0x0, 0x0, 0x0)\n\t/Users/fzh/go/src/github.com/pingcap/tidb/executor/compiler.go:62 +0x2fd\ngithub.com/pingcap/tidb/session.(*session).ExecuteStmt(0xc0009b3300, 0x6aae200, 0xc0010c4540, 0x6ad1f20, 0xc0010a3ec0, 0x0, 0x0, 0x0, 0x0)\n\t/Users/fzh/go/src/github.com/pingcap/tidb/session/session.go:1379 +0x33a\ngithub.com/pingcap/tidb/server.(*TiDBContext).ExecuteStmt(0xc00101b050, 0x6aae200, 0xc0010c4540, 0x6ad1f20, 0xc0010a3ec0, 0xc0006a8210, 0x6aae200, 0xc0010c4540, 0x874ae58)\n\t/Users/fzh/go/src/github.com/pingcap/tidb/server/driver_tidb.go:212 +0x68\ngithub.com/pingcap/tidb/server.(*clientConn).handleStmt(0xc000137100, 0x6aae200, 0xc0010c4540, 0x6ad1f20, 0xc0010a3ec0, 0x874ae58, 0x0, 0x0, 0x1, 0x0, ...)\n\t/Users/fzh/go/src/github.com/pingcap/tidb/server/conn.go:1561 +0x139\ngithub.com/pingcap/tidb/server.(*clientConn).handleQuery(0xc000137100, 0x6aae140, 0xc0010a3e40, 0xc000f5e431, 0xd, 0x0, 0x0)\n\t/Users/fzh/go/src/github.com/pingcap/tidb/server/conn.go:1453 +0x49b\ngithub.com/pingcap/tidb/server.(*clientConn).dispatch(0xc000137100, 0x6aae140, 0xc0010a3e40, 0xc000f5e430, 0xe, 0xd, 0x0, 0x0)\n\t/Users/fzh/go/src/github.com/pingcap/tidb/server/conn.go:1027 +0x696\ngithub.com/pingcap/tidb/server.(*clientConn).Run(0xc000137100, 0x6aae200, 0xc000f65860)\n\t/Users/fzh/go/src/github.com/pingcap/tidb/server/conn.go:792 +0x29c\ngithub.com/pingcap/tidb/server.(*Server).onConn(0xc0010c61a0, 0xc000137100)\n\t/Users/fzh/go/src/github.com/pingcap/tidb/server/server.go:461 +0xa97\ncreated by github.com/pingcap/tidb/server.(*Server).Run\n\t/Users/fzh/go/src/github.com/pingcap/tidb/server/server.go:364 +0x894\n"]
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: None
Edition: Community
Git Commit Hash: None
Git Branch: None
UTC Build Time: None
GoVersion: go1.14.3
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
What's the version and schema?
What's the version and schema?
the latest master,
create table t (id int, value decimal(5,2));
An explanation about desc table t: actually it is equivalent to
explain select * from t;
after the support for VALUES and TABLE statements (https://github.com/pingcap/tidb/issues/19934 closed by https://github.com/pingcap/parser/pull/1026)
The author of extractSelectAndNormalizeDigest may assume that a SelectStmt must contains the substring "select" :)
Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: https://github.com/pingcap/tidb/issues/20100
[v5.0.0-rc]
master
Most helpful comment
An explanation about
desc table t: actually it is equivalent toafter the support for
VALUESandTABLEstatements (https://github.com/pingcap/tidb/issues/19934 closed by https://github.com/pingcap/parser/pull/1026)The author of
extractSelectAndNormalizeDigestmay assume that aSelectStmtmust contains the substring "select" :)https://github.com/pingcap/tidb/blob/51794e9d304896a315d80ccb4603f59dc75f26d9/planner/optimize.go#L299-L300