Skip to content

Commit

Permalink
executor: fix unexpected results when do index merge join on outer jo…
Browse files Browse the repository at this point in the history
…in (#20581) (#20954)

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
  • Loading branch information
ti-srebot authored Nov 13, 2020
1 parent 6c4ec85 commit c05d221
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions executor/index_lookup_merge_join.go
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,9 @@ func (imw *innerMergeWorker) doMergeJoin(ctx context.Context, task *lookUpMergeJ
for _, outerIdx := range task.outerOrderIdx {
outerRow := task.outerResult.GetRow(outerIdx)
hasMatch, hasNull, cmpResult := false, false, initCmpResult
if task.outerMatch != nil && !task.outerMatch[outerIdx.ChkIdx][outerIdx.RowIdx] {
goto missMatch
}
// If it has iterated out all inner rows and the inner rows with same key is empty,
// that means the outer row needn't match any inner rows.
if noneInnerRowsRemain && len(task.sameKeyInnerRows) == 0 {
Expand Down

0 comments on commit c05d221

Please sign in to comment.