Skip to content

Commit

Permalink
planner, util: new unfixed mutrow for TypeNull
Browse files Browse the repository at this point in the history
  • Loading branch information
XuHuaiyu committed Jun 10, 2020
1 parent e053ce0 commit 23f9cad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions planner/core/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1117,3 +1117,14 @@ func (s *testIntegrationSuite) TestHintParserWarnings(c *C) {
rows := tk.MustQuery("show warnings;").Rows()
c.Assert(len(rows), Equals, 1)
}

func (s *testIntegrationSuite) TestIssue16935(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
tk.MustExec("drop table if exists t0;")
tk.MustExec("CREATE TABLE t0(c0 INT);")
tk.MustExec("INSERT INTO t0(c0) VALUES (1), (1), (1), (1), (1), (1);")
tk.MustExec("CREATE definer='root'@'localhost' VIEW v0(c0) AS SELECT NULL FROM t0;")

tk.MustQuery("SELECT * FROM t0 LEFT JOIN v0 ON TRUE WHERE v0.c0 IS NULL;")
}
2 changes: 1 addition & 1 deletion util/chunk/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,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.TypeNull:
mysql.TypeLonglong, mysql.TypeDouble, mysql.TypeYear, mysql.TypeDuration:
return 8
case mysql.TypeDate, mysql.TypeDatetime, mysql.TypeTimestamp:
return sizeTime
Expand Down
2 changes: 1 addition & 1 deletion util/chunk/mutrow.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func zeroValForType(tp *types.FieldType) interface{} {
func makeMutRowColumn(in interface{}) *Column {
switch x := in.(type) {
case nil:
col := makeMutRowUint64Column(uint64(0))
col := makeMutRowBytesColumn(nil)
col.nullBitmap[0] = 0
return col
case int:
Expand Down

0 comments on commit 23f9cad

Please sign in to comment.