From 08a5d40159d39f470392feff5f11065c8ee73089 Mon Sep 17 00:00:00 2001 From: zyguan Date: Fri, 16 Dec 2022 10:56:19 +0000 Subject: [PATCH] address https://github.com/pingcap/tidb/pull/39993#discussion_r1050541556 Signed-off-by: zyguan --- tests/realtikvtest/pessimistictest/pessimistic_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/realtikvtest/pessimistictest/pessimistic_test.go b/tests/realtikvtest/pessimistictest/pessimistic_test.go index b69f65bff3091..ae7545e0e91f6 100644 --- a/tests/realtikvtest/pessimistictest/pessimistic_test.go +++ b/tests/realtikvtest/pessimistictest/pessimistic_test.go @@ -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) @@ -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) {