Skip to content

Commit

Permalink
executor: fix data race in the IndexNestedLoopHashJoin (pingcap#31731)
Browse files Browse the repository at this point in the history
  • Loading branch information
wshwsh12 authored Jan 17, 2022
1 parent 6db56bb commit ca7ff0a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion executor/index_lookup_hash_join.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,9 @@ func (iw *indexHashJoinInnerWorker) run(ctx context.Context, cancelFunc context.
break
}
err := iw.handleTask(ctx, task, joinResult, h, resultCh)
if err != nil {
if err != nil && !task.keepOuterOrder {
// Only need check non-keep-outer-order case because the
// `joinResult` had been sent to the `resultCh` when err != nil.
joinResult.err = err
break
}
Expand Down

0 comments on commit ca7ff0a

Please sign in to comment.