Skip to content

Commit

Permalink
executor: fix bug of tiflash executing apply (#19182)
Browse files Browse the repository at this point in the history
Co-authored-by: ti-srebot <[email protected]>
  • Loading branch information
hanfei1991 and ti-srebot authored Aug 14, 2020
1 parent 759e00c commit 783d2f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions executor/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -2438,6 +2438,7 @@ func buildNoRangeTableReader(b *executorBuilder, v *plannercore.PhysicalTableRea
corColInFilter: b.corColInDistPlan(v.TablePlans),
corColInAccess: b.corColInAccess(v.TablePlans[0]),
plans: v.TablePlans,
tablePlan: v.GetTablePlan(),
storeType: v.StoreType,
}
e.setBatchCop(v)
Expand Down
15 changes: 12 additions & 3 deletions executor/table_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ type TableReaderExecutor struct {
resultHandler *tableResultHandler
feedback *statistics.QueryFeedback
plans []plannercore.PhysicalPlan
tablePlan plannercore.PhysicalPlan

memTracker *memory.Tracker
selectResultHook // for testing
Expand Down Expand Up @@ -105,9 +106,17 @@ func (e *TableReaderExecutor) Open(ctx context.Context) error {

var err error
if e.corColInFilter {
e.dagPB.Executors, _, err = constructDistExec(e.ctx, e.plans)
if err != nil {
return err
if e.storeType == kv.TiFlash {
execs, _, err := constructDistExecForTiFlash(e.ctx, e.tablePlan)
if err != nil {
return err
}
e.dagPB.RootExecutor = execs[0]
} else {
e.dagPB.Executors, _, err = constructDistExec(e.ctx, e.plans)
if err != nil {
return err
}
}
}
if e.runtimeStats != nil {
Expand Down

0 comments on commit 783d2f0

Please sign in to comment.