Skip to content

Commit

Permalink
add expression index test
Browse files Browse the repository at this point in the history
  • Loading branch information
tangenta committed Jul 8, 2022
1 parent 9243a2b commit 44ff9f1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions ddl/multi_schema_change_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ func TestMultiSchemaChangeAddColumns(t *testing.T) {
tk.MustExec("alter table t add column (index i(a));")
tk.MustQuery("select * from t use index (i)").Check(testkit.Rows("1"))

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, 2, 3);")
tk.MustExec("alter table t add column (index i1(a, b, c), index i2(c, b, a), index i3((a + 1)), index i4((c - 1)));")
tk.MustQuery("select * from t use index (i1, i2);").Check(testkit.Rows("1 2 3"))
tk.MustExec("admin check table t;")

tk.MustExec("drop table if exists t;")
tk.MustExec("create table t (a int default 1);")
tk.MustExec("insert into t values ();")
Expand Down Expand Up @@ -323,13 +330,6 @@ func TestMultiSchemaChangeAddIndexes(t *testing.T) {
tk.MustQuery("select * from t use index (t, t1, t2, t3);").Check(testkit.Rows("1 2 3"))
tk.MustExec("admin check table t;")

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, 2, 3);")
tk.MustExec("alter table t add column (index i1(a, b, c), index i2(c, b, a));")
tk.MustQuery("select * from t use index (i1, i2);").Check(testkit.Rows("1 2 3"))
tk.MustExec("admin check table t;")

// Test add multiple indexes with same name.
tk.MustExec("drop table if exists t")
tk.MustExec("create table t (a int, b int, c int)")
Expand Down

0 comments on commit 44ff9f1

Please sign in to comment.