Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
qw4990 committed Nov 9, 2022
1 parent d56fab9 commit 0758ad0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions executor/insert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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) {
Expand Down Expand Up @@ -357,17 +356,16 @@ 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")
tk.MustExec("create table t1 (a int(11) ,b varchar(100) ,primary key (a));")
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) {
Expand Down

0 comments on commit 0758ad0

Please sign in to comment.