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

Add expression index in multi-schema change panic #110

Closed
tangenta opened this issue Jun 15, 2022 · 0 comments · Fixed by #113
Closed

Add expression index in multi-schema change panic #110

tangenta opened this issue Jun 15, 2022 · 0 comments · Fixed by #113
Labels
bug Something isn't working

Comments

@tangenta
Copy link
Owner

tangenta commented Jun 15, 2022

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table if exists t;
create table t (a int, b int);
insert into t values (1, 2), (2, 1);
alter table t add column c int default 10, add index idx1((a + b)), add unique index idx2((a + b));

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

ERROR 1062 (23000): Duplicate entry '3' for key 't.idx2'

3. What did you see instead (Required)

ERROR 1105 (HY000): When the state is JobStateRollbackDone or JobStateCancelled, historyJob.Error should never be nil

Log output

[2022/06/15 10:27:01.531 +08:00] [ERROR] [misc.go:109] ["panic in the recoverable goroutine"] [label=ddl-worker] [funcInfo="worker 2, tp reorg runDDLJob"] [r="\"invalid memory address or nil pointer dereference\""] [stack="github.com/pingcap/tidb/util.Recover
  /Users/tangenta/gopath/src/github.com/pingcap/tidb/util/misc.go:113
runtime.gopanic
  /opt/homebrew/Cellar/go/1.18.1/libexec/src/runtime/panic.go:844
runtime.panicmem
  /opt/homebrew/Cellar/go/1.18.1/libexec/src/runtime/panic.go:220
runtime.sigpanic
  /opt/homebrew/Cellar/go/1.18.1/libexec/src/runtime/signal_unix.go:818
github.com/pingcap/tidb/parser/model.FindColumnInfo
  /Users/tangenta/gopath/src/github.com/pingcap/tidb/parser/model/model.go:285
github.com/pingcap/tidb/ddl.getPrimaryKey
  /Users/tangenta/gopath/src/github.com/pingcap/tidb/ddl/ddl_api.go:1662
github.com/pingcap/tidb/ddl.checkInvisibleIndexOnPK
  /Users/tangenta/gopath/src/github.com/pingcap/tidb/ddl/ddl_api.go:1631
github.com/pingcap/tidb/ddl.(*worker).onCreateIndex
  /Users/tangenta/gopath/src/github.com/pingcap/tidb/ddl/index.go:542
github.com/pingcap/tidb/ddl.(*worker).runDDLJob
  /Users/tangenta/gopath/src/github.com/pingcap/tidb/ddl/ddl_worker.go:893
github.com/pingcap/tidb/ddl.onMultiSchemaChange
  /Users/tangenta/gopath/src/github.com/pingcap/tidb/ddl/multi_schema_change.go:94
github.com/pingcap/tidb/ddl.(*worker).runDDLJob
  /Users/tangenta/gopath/src/github.com/pingcap/tidb/ddl/ddl_worker.go:959
github.com/pingcap/tidb/ddl.(*worker).handleDDLJobQueue.func1
  /Users/tangenta/gopath/src/github.com/pingcap/tidb/ddl/ddl_worker.go:645
github.com/pingcap/tidb/kv.RunInNewTxn
  /Users/tangenta/gopath/src/github.com/pingcap/tidb/kv/txn.go:127
github.com/pingcap/tidb/ddl.(*worker).handleDDLJobQueue
  /Users/tangenta/gopath/src/github.com/pingcap/tidb/ddl/ddl_worker.go:598
github.com/pingcap/tidb/ddl.(*worker).start
  /Users/tangenta/gopath/src/github.com/pingcap/tidb/ddl/ddl_worker.go:211"]

4. What is your TiDB version? (Required)

a75690f

@tangenta tangenta added the bug Something isn't working label Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant