From d2a220de5699d046fc42a723fb8849cd751f9622 Mon Sep 17 00:00:00 2001 From: zyguan Date: Thu, 23 Mar 2023 12:59:22 +0800 Subject: [PATCH] resolve conflicts Signed-off-by: zyguan --- .../pessimistictest/pessimistic_test.go | 64 ------------------- 1 file changed, 64 deletions(-) diff --git a/tests/realtikvtest/pessimistictest/pessimistic_test.go b/tests/realtikvtest/pessimistictest/pessimistic_test.go index 3beadd726d830..ad40080c765a9 100644 --- a/tests/realtikvtest/pessimistictest/pessimistic_test.go +++ b/tests/realtikvtest/pessimistictest/pessimistic_test.go @@ -2816,71 +2816,7 @@ func TestAsyncCommitCalTSFail(t *testing.T) { tk2.MustExec("commit") } -<<<<<<< HEAD -func TestChangeLockToPut(t *testing.T) { -======= -func TestAsyncCommitAndForeignKey(t *testing.T) { - defer config.RestoreFunc()() - config.UpdateGlobal(func(conf *config.Config) { - conf.TiKVClient.AsyncCommit.SafeWindow = time.Second - conf.TiKVClient.AsyncCommit.AllowedClockDrift = 0 - }) - store := realtikvtest.CreateMockStoreAndSetup(t) - tk := createAsyncCommitTestKit(t, store) - tk.MustExec("drop table if exists t_parent, t_child") - tk.MustExec("create table t_parent (id int primary key)") - tk.MustExec("create table t_child (id int primary key, pid int, foreign key (pid) references t_parent(id) on delete cascade on update cascade)") - tk.MustExec("insert into t_parent values (1),(2),(3),(4)") - tk.MustExec("insert into t_child values (1,1),(2,2),(3,3)") - tk.MustExec("set tidb_enable_1pc = true") - tk.MustExec("begin pessimistic") - tk.MustExec("delete from t_parent where id in (1,4)") - tk.MustExec("update t_parent set id=22 where id=2") - tk.MustExec("commit") - tk.MustQuery("select * from t_parent order by id").Check(testkit.Rows("3", "22")) - tk.MustQuery("select * from t_child order by id").Check(testkit.Rows("2 22", "3 3")) -} - -func TestTransactionIsolationAndForeignKey(t *testing.T) { - if !*realtikvtest.WithRealTiKV { - t.Skip("The test only support test with tikv.") - } - store := realtikvtest.CreateMockStoreAndSetup(t) - tk := testkit.NewTestKit(t, store) - tk2 := testkit.NewTestKit(t, store) - tk.MustExec("use test") - tk2.MustExec("use test") - tk.MustExec("drop table if exists t1,t2") - tk.MustExec("create table t1 (id int primary key)") - tk.MustExec("create table t2 (id int primary key, pid int, foreign key (pid) references t1(id) on delete cascade on update cascade)") - tk.MustExec("insert into t1 values (1)") - tk.MustExec("set tx_isolation = 'READ-COMMITTED'") - tk.MustExec("begin pessimistic") - tk.MustExec("insert into t2 values (1,1)") - tk.MustGetDBError("insert into t2 values (2,2)", plannercore.ErrNoReferencedRow2) - tk2.MustExec("insert into t1 values (2)") - tk.MustQuery("select * from t1").Check(testkit.Rows("1", "2")) - tk.MustExec("insert into t2 values (2,2)") - var wg sync.WaitGroup - wg.Add(1) - go func() { - defer wg.Done() - tk2.MustExec("delete from t1 where id=2") - }() - time.Sleep(time.Millisecond * 10) - tk.MustExec("commit") - wg.Wait() - tk.MustQuery("select * from t1").Check(testkit.Rows("1")) - tk.MustQuery("select * from t2").Check(testkit.Rows("1 1")) - tk2.MustExec("delete from t1 where id=1") - tk.MustQuery("select * from t1").Check(testkit.Rows()) - tk.MustQuery("select * from t2").Check(testkit.Rows()) - tk.MustExec("admin check table t1") - tk.MustExec("admin check table t2") -} - func TestIssue28011(t *testing.T) { ->>>>>>> 273763b51e8 (executor: revert #25730 to fix #28011 (#42488)) store := realtikvtest.CreateMockStoreAndSetup(t) tk := testkit.NewTestKit(t, store)