Skip to content

Commit

Permalink
ddl: scattering truncated tables without pre-split option (#22787) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-srebot authored Mar 1, 2021
1 parent 058e52a commit 17f20a7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions ddl/ddl_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -3716,11 +3716,8 @@ func (d *ddl) TruncateTable(ctx sessionctx.Context, ti ast.Ident) error {
}
return errors.Trace(err)
}
oldTblInfo := tb.Meta()
if oldTblInfo.PreSplitRegions > 0 {
if _, tb, err := d.getSchemaAndTableByIdent(ctx, ti); err == nil {
d.preSplitAndScatter(ctx, tb.Meta(), tb.Meta().GetPartitionInfo())
}
if _, tb, err := d.getSchemaAndTableByIdent(ctx, ti); err == nil {
d.preSplitAndScatter(ctx, tb.Meta(), tb.Meta().GetPartitionInfo())
}

if !config.TableLockEnabled() {
Expand Down

0 comments on commit 17f20a7

Please sign in to comment.