diff --git a/ddl/backfilling.go b/ddl/backfilling.go index 0f77978e61e71..61edd6857a6c1 100644 --- a/ddl/backfilling.go +++ b/ddl/backfilling.go @@ -399,6 +399,11 @@ func splitTableRanges(t table.PhysicalTable, store kv.Storage, startKey, endKey zap.Int64("physicalTableID", t.GetPhysicalID()), zap.String("start key", hex.EncodeToString(startKey)), zap.String("end key", hex.EncodeToString(endKey))) + if len(startKey) == 0 && len(endKey) == 0 { + logutil.BgLogger().Info("split table range from PD, get noop table range", zap.String("category", "ddl"), zap.Int64("physicalTableID", t.GetPhysicalID())) + return []kv.KeyRange{}, nil + } + kvRange := kv.KeyRange{StartKey: startKey, EndKey: endKey} s, ok := store.(tikv.Storage) if !ok { @@ -685,9 +690,6 @@ func (dc *ddlCtx) writePhysicalTableRecord(sessPool *sess.Pool, t table.Physical if err := dc.isReorgRunnable(reorgInfo.Job.ID, false); err != nil { return errors.Trace(err) } - if startKey == nil && endKey == nil { - return nil - } failpoint.Inject("MockCaseWhenParseFailure", func(val failpoint.Value) { //nolint:forcetypeassert