diff --git a/planner/core/find_best_task.go b/planner/core/find_best_task.go index 17672deaacdeb..80517b6f51da1 100644 --- a/planner/core/find_best_task.go +++ b/planner/core/find_best_task.go @@ -2027,7 +2027,7 @@ func (ds *DataSource) convertToTableScan(prop *property.PhysicalProperty, candid // when got here, canMppConvertToRootForDisaggregatedTiFlash is true. task = mppTask task = task.convertToRootTask(ds.ctx) - if task != nil && !task.invalid() { + if !task.invalid() { ds.addSelection4PlanCache(task.(*rootTask), ds.stats.ScaleByExpectCnt(prop.ExpectedCnt), prop) } }