Skip to content

Commit

Permalink
fix panic
Browse files Browse the repository at this point in the history
  • Loading branch information
winoros committed Dec 12, 2017
1 parent 4c23535 commit 830f5bc
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions executor/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,24 +581,30 @@ func (b *executorBuilder) buildHashJoin(v *plan.PhysicalHashJoin) Executor {
}

defaultValues := v.DefaultValues
if defaultValues == nil {
defaultValues = make([]types.Datum, e.innerExec.Schema().Len())
}
e.resultGenerator = newJoinResultGenerator(b.ctx, v.JoinType, v.SmallChildIdx == 0, defaultValues, v.OtherConditions, nil, nil)
if v.SmallChildIdx == 0 {
e.innerExec = leftExec
e.outerExec = rightExec
e.innerFilter = v.LeftConditions
e.outerFilter = v.RightConditions
e.innerKeys = leftHashKey
e.outerKeys = rightHashKey
if defaultValues == nil {
defaultValues = make([]types.Datum, e.innerExec.Schema().Len())
}
e.resultGenerator = newJoinResultGenerator(b.ctx, v.JoinType, v.SmallChildIdx == 0, defaultValues,
v.OtherConditions, nil, nil)
} else {
e.innerExec = rightExec
e.outerExec = leftExec
e.innerFilter = v.RightConditions
e.outerFilter = v.LeftConditions
e.innerKeys = rightHashKey
e.outerKeys = leftHashKey
if defaultValues == nil {
defaultValues = make([]types.Datum, e.innerExec.Schema().Len())
}
e.resultGenerator = newJoinResultGenerator(b.ctx, v.JoinType, v.SmallChildIdx == 0,
defaultValues, v.OtherConditions, nil, nil)
}

return e
Expand Down

0 comments on commit 830f5bc

Please sign in to comment.