Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
Reminiscent committed Dec 12, 2022
1 parent cf370d3 commit f800e5c
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions executor/insert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,27 +343,20 @@ func (s *testSuite3) TestUpdateDuplicateKey(c *C) {
c.Assert(err.Error(), Equals, "[kv:1062]Duplicate entry '1-2-4' for key 'PRIMARY'")
}

<<<<<<< HEAD
func (s *testSuite3) TestInsertWrongValueForField(c *C) {
func (s *testSuite3) TestIssue37187(c *C) {
tk := testkit.NewTestKit(c, s.store)
=======
func TestIssue37187(t *testing.T) {
store := testkit.CreateMockStore(t)
tk := testkit.NewTestKit(t, 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, Equals, nil)
}

func TestInsertWrongValueForField(t *testing.T) {
store := testkit.CreateMockStore(t)
tk := testkit.NewTestKit(t, store)
>>>>>>> d5b2c9b17d (planner: fix panic when prepare and execute the insert on duplicate (#37924))
func (s *testSuite3) TestInsertWrongValueForField(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
tk.MustExec(`drop table if exists t1;`)
tk.MustExec(`create table t1(a bigint);`)
Expand Down

0 comments on commit f800e5c

Please sign in to comment.