diff --git a/planner/core/integration_test.go b/planner/core/integration_test.go index 386889fd7970d..0b1e1b1691544 100644 --- a/planner/core/integration_test.go +++ b/planner/core/integration_test.go @@ -801,3 +801,14 @@ func (s *testIntegrationSuite) TestStreamAggProp(c *C) { tk.MustQuery(tt).Check(testkit.Rows(output[i].Res...)) } } + +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;") +} diff --git a/util/chunk/codec.go b/util/chunk/codec.go index 498e034000269..4458dbe76e1bc 100644 --- a/util/chunk/codec.go +++ b/util/chunk/codec.go @@ -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.TypeNull: + mysql.TypeLonglong, mysql.TypeDouble, mysql.TypeYear, mysql.TypeDuration: return 8 case mysql.TypeDate, mysql.TypeDatetime, mysql.TypeTimestamp: return 16 diff --git a/util/chunk/mutrow.go b/util/chunk/mutrow.go index 15b5f29999db5..5e8ee0802e27f 100644 --- a/util/chunk/mutrow.go +++ b/util/chunk/mutrow.go @@ -109,7 +109,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: