Skip to content

Commit

Permalink
mpp: throw an err when mpp generate empty table scan task list (#33084)…
Browse files Browse the repository at this point in the history
… (#33136)

close #33083
  • Loading branch information
ti-srebot authored Apr 14, 2022
1 parent 8e57dd5 commit f155f58
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions planner/core/fragment.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@ func (e *mppTaskGenerator) generateMPPTasksForFragment(f *Fragment) (tasks []*kv
}
if f.TableScan != nil {
tasks, err = e.constructMPPTasksImpl(context.Background(), f.TableScan)
if err == nil && len(tasks) == 0 {
err = errors.New(
"In mpp mode, the number of tasks for table scan should not be zero. " +
"Please set tidb_allow_mpp = 0, and then rerun sql.")
}
} else {
childrenTasks := make([]*kv.MPPTask, 0)
for _, r := range f.ExchangeReceivers {
Expand Down

0 comments on commit f155f58

Please sign in to comment.