Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

planner, util: new unfixed mutrow for TypeNull (#17893) #17935

Merged
merged 6 commits into from
Jun 28, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions planner/core/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,3 +408,14 @@ func (s *testIntegrationSuite) TestTableDualWithRequiredProperty(c *C) {
tk.MustExec("create table t2 (a int, b int)")
tk.MustExec("select /*+ MERGE_JOIN(t1, t2) */ * from t1 partition (p0), t2 where t1.a > 100 and t1.a = t2.a")
}

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 @@ -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
Expand Down
2 changes: 1 addition & 1 deletion util/chunk/mutrow.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down