diff --git a/pkg/ddl/column.go b/pkg/ddl/column.go index 4d30f6f9396e3..4f02355febc01 100644 --- a/pkg/ddl/column.go +++ b/pkg/ddl/column.go @@ -529,6 +529,10 @@ func (w *worker) updateCurrentElement(t table.Table, reorgInfo *reorgInfo) error if err != nil { return errors.Trace(err) } + if pt, ok := t.(table.PartitionedTable); ok { + // Restart from first partition + reorgInfo.PhysicalTableID = pt.Meta().Partition.Definitions[0].ID + } } currentVer, err := getValidCurrentVersion(reorgInfo.jobCtx.store) @@ -583,6 +587,10 @@ func (w *worker) updateCurrentElement(t table.Table, reorgInfo *reorgInfo) error if err != nil { return errors.Trace(err) } + if pt, ok := t.(table.PartitionedTable); ok { + // Restart from first partition + reorgInfo.PhysicalTableID = pt.Meta().Partition.Definitions[0].ID + } } return nil }