Skip to content

Commit

Permalink
move test to realtikvtest
Browse files Browse the repository at this point in the history
Signed-off-by: ekexium <ekexium@gmail.com>
  • Loading branch information
ekexium committed Feb 16, 2023
1 parent 1033de1 commit a5ea7ec
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
12 changes: 0 additions & 12 deletions executor/point_get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -842,15 +842,3 @@ func TestPointGetIssue40194(t *testing.T) {
tk2.MustExec("update t1 set v=v+1")
tk.MustQuery("execute s").Check(testkit.Rows("1 11"))
}

func TestPointLockNonExistentKeyWithAggressiveLockingUnderRC(t *testing.T) {
store := testkit.CreateMockStore(t)
tk := testkit.NewTestKit(t, store)
tk.MustExec("set tx_isolation = 'READ-COMMITTED'")
tk.MustExec("set @@tidb_pessimistic_txn_aggressive_locking=1")
tk.MustExec("use test")
tk.MustExec("create table t (a int primary key, b int)")
tk.MustExec("begin pessimistic")
tk.MustExec("select * from t where a = 1 for update")
tk.MustExec("commit")
}
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -933,8 +933,6 @@ github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2 h1:mbAskLJ0oJf
github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2/go.mod h1:2PfKggNGDuadAa0LElHrByyrz4JPZ9fFx6Gs7nx7ZZU=
github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a h1:J/YdBZ46WKpXsxsW93SG+q0F8KI+yFrcIDT4c/RNoc4=
github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a/go.mod h1:h4xBhSNtOeEosLJ4P7JyKXX7Cabg7AVkWCK5gV2vOrM=
github.com/tikv/client-go/v2 v2.0.6-0.20230209044022-95ebf6a86301 h1:kiPiEBubzB2Ef2yPfoItQpjhGepcZSlRyqrXnfs92pQ=
github.com/tikv/client-go/v2 v2.0.6-0.20230209044022-95ebf6a86301/go.mod h1:KMEFxpYwZ3MIvW4lrSy9dXgtrLojw9c9//2XlS5TGzw=
github.com/tikv/pd/client v0.0.0-20230209034200-6d23a31c24be h1:hauBQBHSyrUxAI0zvkTiBKd472c+Iy+aY0Jd+b9VOJ8=
github.com/tikv/pd/client v0.0.0-20230209034200-6d23a31c24be/go.mod h1:ryhYHDwupsZHeOOF/N7So+1hbtAnuw0K2A+pKOElSVs=
github.com/timakin/bodyclose v0.0.0-20221125081123-e39cf3fc478e h1:MV6KaVu/hzByHP0UvJ4HcMGE/8a6A4Rggc/0wx2AvJo=
Expand Down
12 changes: 12 additions & 0 deletions tests/realtikvtest/pessimistictest/pessimistic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3356,3 +3356,15 @@ func TestIssue40114(t *testing.T) {
tk.MustExec("admin check table t")
tk.MustQuery("select * from t").Check(testkit.Rows("1 1", "2 3"))
}

func TestPointLockNonExistentKeyWithAggressiveLockingUnderRC(t *testing.T) {
store := realtikvtest.CreateMockStoreAndSetup(t)
tk := testkit.NewTestKit(t, store)
tk.MustExec("set tx_isolation = 'READ-COMMITTED'")
tk.MustExec("set @@tidb_pessimistic_txn_aggressive_locking=1")
tk.MustExec("use test")
tk.MustExec("create table t (a int primary key, b int)")
tk.MustExec("begin pessimistic")
tk.MustExec("select * from t where a = 1 for update")
tk.MustExec("commit")
}

0 comments on commit a5ea7ec

Please sign in to comment.