Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wshwsh12 committed Apr 14, 2021
1 parent ccb8e30 commit d065449
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions expression/constant_propagation.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,9 @@ func (s *propOuterJoinConstSolver) deriveConds(outerCol, innerCol *Column, schem
// 'expression(..., outerCol, ...)' does not reference columns outside children schemas of join node.
// Derived new expressions must be appended into join condition, not filter condition.
func (s *propOuterJoinConstSolver) propagateColumnEQ() {
if s.nullSensitive {
return
}
visited := make([]bool, 2*len(s.joinConds)+len(s.filterConds))
s.unionSet = disjointset.NewIntSet(len(s.columns))
var outerCol, innerCol *Column
Expand All @@ -553,9 +556,6 @@ func (s *propOuterJoinConstSolver) propagateColumnEQ() {
// `select *, t1.a in (select t2.b from t t2) from t t1`
// rows with t2.b is null would impact whether LeftOuterSemiJoin should output 0 or null if there
// is no row satisfying t2.b = t1.a
if s.nullSensitive {
continue
}
childCol := s.innerSchema.RetrieveColumn(innerCol)
if !mysql.HasNotNullFlag(childCol.RetType.Flag) {
notNullExpr := BuildNotNullExpr(s.ctx, childCol)
Expand All @@ -576,9 +576,7 @@ func (s *propOuterJoinConstSolver) propagateColumnEQ() {
if outerCol == nil {
continue
}
if !s.nullSensitive {
visited = s.deriveConds(outerCol, innerCol, mergedSchema, lenJoinConds, visited, false)
}
visited = s.deriveConds(outerCol, innerCol, mergedSchema, lenJoinConds, visited, false)
visited = s.deriveConds(outerCol, innerCol, mergedSchema, lenJoinConds, visited, true)
}
}
Expand Down

0 comments on commit d065449

Please sign in to comment.