Skip to content
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

insert data into cache table will lead tidb panic #31077

Closed
aytrack opened this issue Dec 28, 2021 · 2 comments · Fixed by #31079
Closed

insert data into cache table will lead tidb panic #31077

aytrack opened this issue Dec 28, 2021 · 2 comments · Fixed by #31079
Assignees
Labels
feature/developing the related feature is in development severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@aytrack
Copy link
Contributor

aytrack commented Dec 28, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t01(a int);
alter table t01 cache;
insert into table t01 values (1,2), (3, 4);

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

insert success and tidb not panic

3. What did you see instead (Required)

MySQL root@127.0.0.1:test> alter table t01 cache;
Query OK, 0 rows affected
Time: 0.018s
MySQL root@127.0.0.1:test> insert into t01 values (1, 2), (3, 4), (5, 6), (7, 8);
(1105, 'assignment to entry in nil map')

the tidb log

[2021/12/28 11:05:42.616 +08:00] [ERROR] [conn.go:1030] ["connection running loop panic"] [conn=3] [lastSQL="insert into t01 values (1, 2), (3, 4), (5, 6), (7, 8)"] [err="assignment to entry in nil map"] [stack="goroutine 860 [running]:\ngithub.com/pingcap/tidb/server.(*clientConn).Run.func1()\n\t/Users/aytrack/gitproject/pingcap/tidb/server/conn.go:1028 +0x8f\npanic({0x6344000, 0x6c14310})\n\t/usr/local/go/src/runtime/panic.go:1038 +0x215\ngithub.com/pingcap/tidb/executor.(*ExecStmt).SummaryStmt(0xc01794cb60, 0x1)\n\t/Users/aytrack/gitproject/pingcap/tidb/executor/adapter.go:1226 +0x637\ngithub.com/pingcap/tidb/executor.(*ExecStmt).FinishExecuteStmt(0xc01794cb60, 0xc017a3ba10, {0x0, 0x0}, 0x0)\n\t/Users/aytrack/gitproject/pingcap/tidb/executor/adapter.go:926 +0x25f\ngithub.com/pingcap/tidb/session.runStmt({0x6c9aa50, 0xc017a3ba10}, 0xc0102a0e00, {0x6cabff8, 0xc01794cb60})\n\t/Users/aytrack/gitproject/pingcap/tidb/session/session.go:1841 +0x785\ngithub.com/pingcap/tidb/session.(*session).ExecuteStmt(0xc0102a0e00, {0x6c9aa50, 0xc017a3ba10}, {0x6cc7340, 0xc01794c8f0})\n\t/Users/aytrack/gitproject/pingcap/tidb/session/session.go:1699 +0xb25\ngithub.com/pingcap/tidb/server.(*TiDBContext).ExecuteStmt(0xc01118b650, {0x6c9aa50, 0xc017a3ba10}, {0x6cc7340, 0xc01794c8f0})\n\t/Users/aytrack/gitproject/pingcap/tidb/server/driver_tidb.go:219 +0x44\ngithub.com/pingcap/tidb/server.(*clientConn).handleStmt(0xc0103f3e00, {0x6c9a9a8, 0xc018a27040}, {0x6cc7340, 0xc01794c8f0}, {0xc0167b2dc0, 0x0, 0x0}, 0x1)\n\t/Users/aytrack/gitproject/pingcap/tidb/server/conn.go:1971 +0x167\ngithub.com/pingcap/tidb/server.(*clientConn).handleQuery(0xc0103f3e00, {0x6c9a9a8, 0xc018a27040}, {0xc0167ee241, 0x35})\n\t/Users/aytrack/gitproject/pingcap/tidb/server/conn.go:1840 +0x770\ngithub.com/pingcap/tidb/server.(*clientConn).dispatch(0xc0103f3e00, {0x6c9aa50, 0xc011f9fbf0}, {0xc0167ee240, 0x36, 0x36})\n\t/Users/aytrack/gitproject/pingcap/tidb/server/conn.go:1335 +0xead\ngithub.com/pingcap/tidb/server.(*clientConn).Run(0xc0103f3e00, {0x6c9aa50, 0xc011f9fbf0})\n\t/Users/aytrack/gitproject/pingcap/tidb/server/conn.go:1090 +0x253\ngithub.com/pingcap/tidb/server.(*Server).onConn(0xc011256000, 0xc0103f3e00)\n\t/Users/aytrack/gitproject/pingcap/tidb/server/server.go:548 +0x986\ncreated by github.com/pingcap/tidb/server.(*Server).startNetworkListener\n\t/Users/aytrack/gitproject/pingcap/tidb/server/server.go:451 +0x5cf\n"]

4. What is your TiDB version? (Required)

MySQL root@127.0.0.1:test> select tidb_version()\G
***************************[ 1. row ]***************************
tidb_version() | Release Version: v5.4.0-alpha-510-gabb658291
Edition: Community
Git Commit Hash: abb65829101d2f19b69b4e5a4dd0471dbed05915
Git Branch: master
UTC Build Time: 2021-12-27 07:20:45
GoVersion: go1.17.2
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
@aytrack aytrack added type/bug The issue is confirmed as a bug. sig/sql-infra SIG: SQL Infra severity/major labels Dec 28, 2021
@bb7133 bb7133 added the feature/developing the related feature is in development label Dec 28, 2021
@tiancaiamao
Copy link
Contributor

Link #25293

@github-actions
Copy link

Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/developing the related feature is in development severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants