Skip to content

Commit

Permalink
cherry pick pingcap#15512 to release-2.1
Browse files Browse the repository at this point in the history
Signed-off-by: sre-bot <sre-bot@pingcap.com>
  • Loading branch information
lysu authored and sre-bot committed Mar 31, 2020
1 parent 3a5c5d0 commit 7512a25
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions executor/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3259,7 +3259,22 @@ func (s *testSuite3) TestIndexJoinTableDualPanic(c *C) {
Check(testkit.Rows("1 a"))
}

<<<<<<< HEAD
func (s *testSuite3) TestUnionAutoSignedCast(c *C) {
=======
func (s *testSuite3) TestSortLeftJoinWithNullColumnInRightChildPanic(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
tk.MustExec("drop table if exists t1, t2")
tk.MustExec("create table t1(a int)")
tk.MustExec("create table t2(a int)")
tk.MustExec("insert into t1(a) select 1;")
tk.MustQuery("select b.n from t1 left join (select a as a, null as n from t2) b on b.a = t1.a order by t1.a").
Check(testkit.Rows("<nil>"))
}

func (s *testSuiteP1) TestUnionAutoSignedCast(c *C) {
>>>>>>> 01db67b... chunk: make `mysql.TypeNull` be judged as fixedLen (#15512)
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
tk.MustExec("drop table if exists t1,t2")
Expand Down
2 changes: 1 addition & 1 deletion util/chunk/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func getFixedLen(colType *types.FieldType) int {
case mysql.TypeFloat:
return 4
case mysql.TypeTiny, mysql.TypeShort, mysql.TypeInt24, mysql.TypeLong,
mysql.TypeLonglong, mysql.TypeDouble, mysql.TypeYear, mysql.TypeDuration:
mysql.TypeLonglong, mysql.TypeDouble, mysql.TypeYear, mysql.TypeDuration, mysql.TypeNull:
return 8
case mysql.TypeDate, mysql.TypeDatetime, mysql.TypeTimestamp:
return 16
Expand Down

0 comments on commit 7512a25

Please sign in to comment.