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
Signed-off-by: Shuaipeng Yu <[email protected]>
  • Loading branch information
jackysp authored Feb 22, 2021
1 parent 42dcec3 commit 49f3e29
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 @@ -4558,11 +4558,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 49f3e29

Please sign in to comment.