Skip to content

Commit 25c482c

Browse files
committed
planner: add note for typed null projection
1 parent abfa243 commit 25c482c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

pkg/planner/core/rule/rule_outer_join_to_semi_join.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,9 @@ func generateProjectForConvertAntiJoin(p *logicalop.LogicalJoin, innerSchSet *in
385385
projExprs := make([]expression.Expression, 0, len(parentNodeSchema.Columns))
386386
for _, c := range parentNodeSchema.Columns {
387387
if innerSchSet.Has(int(c.UniqueID)) {
388+
// Keep null-extended inner columns aligned with the parent schema type.
389+
// NewNull() defaults to TINYINT, while the original column can have
390+
// another type and must become nullable after the outer join rewrite.
388391
retType := c.RetType.Clone()
389392
retType.DelFlag(mysql.NotNullFlag)
390393
projExprs = append(projExprs, expression.NewNullWithFieldType(retType))

0 commit comments

Comments
 (0)