Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Signed-off-by: zyguan <zhongyangguan@gmail.com>
  • Loading branch information
zyguan authored and ti-chi-bot committed Dec 16, 2022
1 parent 14f9065 commit 08a5d40
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/realtikvtest/pessimistictest/pessimistic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3085,6 +3085,10 @@ func TestPessimisticAutoCommitTxn(t *testing.T) {
explain = fmt.Sprintf("%v", rows[1])
require.Regexp(t, ".*handle:-1.*", explain)
require.NotRegexp(t, ".*handle:-1, lock.*", explain)
rows = tk.MustQuery("explain update t set i = -i where i in (-1, 1)").Rows()
explain = fmt.Sprintf("%v", rows[1])
require.Regexp(t, ".*handle:\\[-1 1\\].*", explain)
require.NotRegexp(t, ".*handle:\\[-1 1\\].*, lock.*", explain)

originCfg := config.GetGlobalConfig()
defer config.StoreGlobalConfig(originCfg)
Expand All @@ -3098,6 +3102,9 @@ func TestPessimisticAutoCommitTxn(t *testing.T) {
rows = tk.MustQuery("explain update t set i = -i where i = -1").Rows()
explain = fmt.Sprintf("%v", rows[1])
require.Regexp(t, ".*handle:-1, lock.*", explain)
rows = tk.MustQuery("explain update t set i = -i where i in (-1, 1)").Rows()
explain = fmt.Sprintf("%v", rows[1])
require.Regexp(t, ".*handle:\\[-1 1\\].*, lock.*", explain)
}

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

0 comments on commit 08a5d40

Please sign in to comment.