From 0758ad0bba2d03a09696703c03c50b0d4785bbf7 Mon Sep 17 00:00:00 2001 From: qw4990 Date: Wed, 9 Nov 2022 17:09:44 +0800 Subject: [PATCH] fixup --- executor/insert_test.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/executor/insert_test.go b/executor/insert_test.go index a8c82d9517f56..a7d592737a41a 100644 --- a/executor/insert_test.go +++ b/executor/insert_test.go @@ -20,9 +20,9 @@ import ( "strconv" "strings" "sync" - "testing" "time" + . "github.com/pingcap/check" "github.com/pingcap/failpoint" "github.com/pingcap/tidb/errno" "github.com/pingcap/tidb/executor" @@ -36,7 +36,6 @@ import ( "github.com/pingcap/tidb/util/israce" "github.com/pingcap/tidb/util/testkit" "github.com/pingcap/tidb/util/testutil" - "github.com/stretchr/testify/require" ) func (s *testSuite8) TestInsertOnDuplicateKey(c *C) { @@ -357,9 +356,8 @@ func (s *testSuite3) TestUpdateDuplicateKey(c *C) { c.Assert(err.Error(), Equals, "[kv:1062]Duplicate entry '1-2-4' for key 'PRIMARY'") } -func TestIssue37187(t *testing.T) { - store := testkit.CreateMockStore(t) - tk := testkit.NewTestKit(t, store) +func (s *testSuite3) TestIssue37187(c *C) { + tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") tk.MustExec("drop table if exists a, b") @@ -367,7 +365,7 @@ func TestIssue37187(t *testing.T) { tk.MustExec("create table t2 (c int(11) ,d varchar(100) ,primary key (c));") tk.MustExec("prepare in1 from 'insert into t1 (a,b) select c,null from t2 t on duplicate key update b=t.d';") err := tk.ExecToErr("execute in1;") - require.NoError(t, err) + c.Assert(err, IsNil) } func (s *testSuite3) TestInsertWrongValueForField(c *C) {