Skip to content

Commit

Permalink
fix testsuite name
Browse files Browse the repository at this point in the history
  • Loading branch information
winoros committed Nov 23, 2020
1 parent bdc984a commit aa4a650
Showing 1 changed file with 1 addition and 86 deletions.
87 changes: 1 addition & 86 deletions executor/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,96 +14,11 @@
package executor_test

import (
"sync"
"time"

. "github.com/pingcap/check"
"github.com/pingcap/tidb/util/testkit"
)

func (s *testSuite8) TestDeleteLockKey(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")

tk.MustExec(`drop table if exists t1, t2, t3, t4, t5, t6;`)

cases := []struct {
ddl string
pre string
tk1Stmt string
tk2Stmt string
}{
{
"create table t1(k int, kk int, val int, primary key(k, kk), unique key(val))",
"insert into t1 values(1, 2, 3)",
"delete from t1 where val = 3",
"insert into t1 values(1, 3, 3)",
},
{
"create table t2(k int, kk int, val int, primary key(k, kk))",
"insert into t2 values(1, 1, 1)",
"delete from t2 where k = 1",
"insert into t2 values(1, 1, 2)",
},
{
"create table t3(k int, kk int, val int, vv int, primary key(k, kk), unique key(val))",
"insert into t3 values(1, 2, 3, 4)",
"delete from t3 where vv = 4",
"insert into t3 values(1, 2, 3, 5)",
},
{
"create table t4(k int, kk int, val int, vv int, primary key(k, kk), unique key(val))",
"insert into t4 values(1, 2, 3, 4)",
"delete from t4 where 1",
"insert into t4 values(1, 2, 3, 5)",
},
{
"create table t5(k int, kk int, val int, vv int, primary key(k, kk), unique key(val))",
"insert into t5 values(1, 2, 3, 4), (2, 3, 4, 5)",
"delete from t5 where k in (1, 2, 3, 4)",
"insert into t5 values(1, 2, 3, 5)",
},
{
"create table t6(k int, kk int, val int, vv int, primary key(k, kk), unique key(val))",
"insert into t6 values(1, 2, 3, 4), (2, 3, 4, 5)",
"delete from t6 where kk between 0 and 10",
"insert into t6 values(1, 2, 3, 5), (2, 3, 4, 6)",
},
}
var wg sync.WaitGroup
for _, t := range cases {
wg.Add(1)
go func(t struct {
ddl string
pre string
tk1Stmt string
tk2Stmt string
}) {
tk1, tk2 := testkit.NewTestKit(c, s.store), testkit.NewTestKit(c, s.store)
tk1.MustExec("use test")
tk2.MustExec("use test")
tk1.MustExec("set session tidb_enable_clustered_index=0")
tk1.MustExec(t.ddl)
tk1.MustExec(t.pre)
tk1.MustExec("begin pessimistic")
tk2.MustExec("begin pessimistic")
tk1.MustExec(t.tk1Stmt)
doneCh := make(chan struct{}, 1)
go func() {
tk2.MustExec(t.tk2Stmt)
doneCh <- struct{}{}
}()
time.Sleep(50 * time.Millisecond)
tk1.MustExec("commit")
<-doneCh
tk2.MustExec("commit")
wg.Done()
}(t)
}
wg.Wait()
}

func (s *testSuite8) TestIssue21200(c *C) {
func (s *testSuite4) TestIssue21200(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("drop database if exists TEST1")
tk.MustExec("create database TEST1")
Expand Down

0 comments on commit aa4a650

Please sign in to comment.