From 44ff9f10135f06eb6a3351ea6ae59c8c592d21e1 Mon Sep 17 00:00:00 2001 From: tangenta Date: Fri, 8 Jul 2022 11:01:04 +0800 Subject: [PATCH] add expression index test --- ddl/multi_schema_change_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ddl/multi_schema_change_test.go b/ddl/multi_schema_change_test.go index fc051e779a947..d994602e4ed96 100644 --- a/ddl/multi_schema_change_test.go +++ b/ddl/multi_schema_change_test.go @@ -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 ();") @@ -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)")