Skip to content

Commit

Permalink
make fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
tangenta committed Jul 18, 2022
1 parent 0261465 commit 381939e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ddl/multi_schema_change_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,22 +528,22 @@ func TestMultiSchemaChangeAddIndexes(t *testing.T) {
tk.MustExec("drop table if exists t")
tk.MustExec("create table t (a int, b int, c int)")
tk.MustGetErrCode("alter table t add index t(a), add index t(b)", errno.ErrUnsupportedDDLOperation)
tk.MustQuery("show index from t;").Check(testkit.Rows( /* no index */))
tk.MustQuery("show index from t;").Check(testkit.Rows( /* no index */ ))

// Test add indexes with drop column.
tk.MustExec("drop table if exists t")
tk.MustExec("create table t (a int, b int, c int)")
tk.MustGetErrCode("alter table t add index t(a), drop column a", errno.ErrUnsupportedDDLOperation)
tk.MustGetErrCode("alter table t add index t(a, b), drop column a", errno.ErrUnsupportedDDLOperation)
tk.MustQuery("show index from t;").Check(testkit.Rows( /* no index */))
tk.MustQuery("show index from t;").Check(testkit.Rows( /* no index */ ))

// Test add index failed.
tk.MustExec("drop table if exists t;")
tk.MustExec("create table t (a int, b int, c int);")
tk.MustExec("insert into t values (1, 1, 1), (2, 2, 2), (3, 3, 1);")
tk.MustGetErrCode("alter table t add unique index i1(a), add unique index i2(a, b), add unique index i3(c);",
errno.ErrDupEntry)
tk.MustQuery("show index from t;").Check(testkit.Rows( /* no index */))
tk.MustQuery("show index from t;").Check(testkit.Rows( /* no index */ ))
tk.MustExec("alter table t add index i1(a), add index i2(a, b), add index i3(c);")
}

Expand All @@ -568,7 +568,7 @@ func TestMultiSchemaChangeAddIndexesCancelled(t *testing.T) {
"add index t2(a), add index t3(a, b);", errno.ErrCancelledDDLJob)
dom.DDL().SetHook(originHook)
cancelHook.MustCancelDone(t)
tk.MustQuery("show index from t;").Check(testkit.Rows( /* no index */))
tk.MustQuery("show index from t;").Check(testkit.Rows( /* no index */ ))
tk.MustQuery("select * from t;").Check(testkit.Rows("1 2 3"))
tk.MustExec("admin check table t;")

Expand Down Expand Up @@ -1075,9 +1075,9 @@ func TestMultiSchemaChangeAlterIndexVisibility(t *testing.T) {
tk.MustExec("use test;")
tk.MustExec("create table t (a int, b int, index idx(b));")
tk.MustExec("alter table t add index idx2(a), alter index idx visible;")
tk.MustQuery("select * from t use index (idx, idx2);").Check(testkit.Rows( /* no rows */))
tk.MustQuery("select * from t use index (idx, idx2);").Check(testkit.Rows( /* no rows */ ))
tk.MustGetErrCode("alter table t drop column b, alter index idx invisible;", errno.ErrKeyDoesNotExist)
tk.MustQuery("select a, b from t;").Check(testkit.Rows( /* no rows */))
tk.MustQuery("select a, b from t;").Check(testkit.Rows( /* no rows */ ))
}

func TestMultiSchemaChangeWithExpressionIndex(t *testing.T) {
Expand Down

0 comments on commit 381939e

Please sign in to comment.