Skip to content

Commit

Permalink
executor: fix dead loop for indexMergeJoin in paging. (pingcap#35918)
Browse files Browse the repository at this point in the history
  • Loading branch information
wshwsh12 authored Jul 11, 2022
1 parent 600fa2e commit 5a01b63
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions executor/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -3885,6 +3885,12 @@ func (builder *dataReaderBuilder) buildTableReaderForIndexJoin(ctx context.Conte
lookUpContents []*indexJoinLookUpContent, indexRanges []*ranger.Range, keyOff2IdxOff []int,
cwc *plannercore.ColWithCmpFuncManager, canReorderHandles bool, memTracker *memory.Tracker, interruptSignal *atomic.Value) (Executor, error) {
e, err := buildNoRangeTableReader(builder.executorBuilder, v)
if !canReorderHandles {
// `canReorderHandles` is set to false only in IndexMergeJoin. IndexMergeJoin will trigger a dead loop problem
// when enabling paging(tidb/issues/35831). But IndexMergeJoin is not visible to the user and is deprecated
// for now. Thus, we disable paging here.
e.paging = false
}
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -4069,6 +4075,7 @@ func (builder *dataReaderBuilder) buildTableReaderBase(ctx context.Context, e *T
SetIsStaleness(e.isStaleness).
SetFromSessionVars(e.ctx.GetSessionVars()).
SetFromInfoSchema(e.ctx.GetInfoSchema()).
SetPaging(e.paging).
Build()
if err != nil {
return nil, err
Expand Down

0 comments on commit 5a01b63

Please sign in to comment.