diff --git a/br/pkg/backup/client.go b/br/pkg/backup/client.go index b675b062793c6..12a4344a432fe 100644 --- a/br/pkg/backup/client.go +++ b/br/pkg/backup/client.go @@ -381,7 +381,7 @@ func skipUnsupportedDDLJob(job *model.Job) bool { case model.ActionCreatePlacementPolicy, model.ActionAlterPlacementPolicy, model.ActionDropPlacementPolicy, - model.ActionAlterTablePartitionPolicy, + model.ActionAlterTablePartitionPlacement, model.ActionModifySchemaDefaultPlacement, model.ActionAlterTablePlacement, model.ActionAlterTableAttributes, diff --git a/ddl/ddl_api.go b/ddl/ddl_api.go index 632aa4874556a..957ba6e68386d 100644 --- a/ddl/ddl_api.go +++ b/ddl/ddl_api.go @@ -6440,7 +6440,7 @@ func (d *ddl) AlterTablePartitionPlacement(ctx sessionctx.Context, tableIdent as SchemaID: schema.ID, TableID: tblInfo.ID, SchemaName: schema.Name.L, - Type: model.ActionAlterTablePartitionPolicy, + Type: model.ActionAlterTablePartitionPlacement, BinlogInfo: &model.HistoryInfo{}, Args: []interface{}{partitionID, policyRefInfo, placementSettings}, } diff --git a/ddl/ddl_worker.go b/ddl/ddl_worker.go index 617c42c639d6c..24c3769217e5d 100644 --- a/ddl/ddl_worker.go +++ b/ddl/ddl_worker.go @@ -838,8 +838,8 @@ func (w *worker) runDDLJob(d *ddlCtx, t *meta.Meta, job *model.Job) (ver int64, ver, err = onDropPlacementPolicy(d, t, job) case model.ActionAlterPlacementPolicy: ver, err = onAlterPlacementPolicy(d, t, job) - case model.ActionAlterTablePartitionPolicy: - ver, err = onAlterTablePartitionOptions(d, t, job) + case model.ActionAlterTablePartitionPlacement: + ver, err = onAlterTablePartitionPlacement(t, job) case model.ActionAlterTablePlacement: ver, err = onAlterTablePlacement(d, t, job) case model.ActionAlterCacheTable: diff --git a/ddl/table.go b/ddl/table.go index 906db66f3ac9d..504f85f83faed 100644 --- a/ddl/table.go +++ b/ddl/table.go @@ -1247,7 +1247,7 @@ func onAlterTablePartitionAttributes(t *meta.Meta, job *model.Job) (ver int64, e return ver, nil } -func onAlterTablePartitionOptions(d *ddlCtx, t *meta.Meta, job *model.Job) (ver int64, err error) { +func onAlterTablePartitionPlacement(t *meta.Meta, job *model.Job) (ver int64, err error) { var partitionID int64 policyRefInfo := &model.PolicyRefInfo{} placementSettings := &model.PlacementSettings{} diff --git a/executor/executor_test.go b/executor/executor_test.go index f503504d739b0..c93aa09e6ccdf 100644 --- a/executor/executor_test.go +++ b/executor/executor_test.go @@ -615,7 +615,7 @@ func (s *testSuiteP2) TestAdminShowDDLJobsInfo(c *C) { "PRIMARY_REGION=\"cn-east-1\" " + "REGIONS=\"cn-east-1, cn-east-2\" " + "FOLLOWERS=2 ") - c.Assert(tk.MustQuery("admin show ddl jobs 1").Rows()[0][3], Equals, "alter table partition policy") + c.Assert(tk.MustQuery("admin show ddl jobs 1").Rows()[0][3], Equals, "alter table partition placement") tk.MustExec("alter table tt1 cache") c.Assert(tk.MustQuery("admin show ddl jobs 1").Rows()[0][3], Equals, "alter table cache") diff --git a/parser/model/ddl.go b/parser/model/ddl.go index 7062e68673210..c61372b55e263 100644 --- a/parser/model/ddl.go +++ b/parser/model/ddl.go @@ -88,7 +88,7 @@ const ( ActionCreatePlacementPolicy ActionType = 51 ActionAlterPlacementPolicy ActionType = 52 ActionDropPlacementPolicy ActionType = 53 - ActionAlterTablePartitionPolicy ActionType = 54 + ActionAlterTablePartitionPlacement ActionType = 54 ActionModifySchemaDefaultPlacement ActionType = 55 ActionAlterTablePlacement ActionType = 56 ActionAlterCacheTable ActionType = 57 @@ -145,7 +145,7 @@ var actionMap = map[ActionType]string{ ActionAlterCheckConstraint: "alter check constraint", ActionDropIndexes: "drop multi-indexes", ActionAlterTableAttributes: "alter table attributes", - ActionAlterTablePartitionPolicy: "alter table partition policy", + ActionAlterTablePartitionPlacement: "alter table partition placement", ActionAlterTablePartitionAttributes: "alter table partition attributes", ActionCreatePlacementPolicy: "create placement policy", ActionAlterPlacementPolicy: "alter placement policy", diff --git a/parser/model/model_test.go b/parser/model/model_test.go index 8c2365ea47ca4..c4968aa48855c 100644 --- a/parser/model/model_test.go +++ b/parser/model/model_test.go @@ -302,7 +302,7 @@ func TestString(t *testing.T) { {ActionModifySchemaCharsetAndCollate, "modify schema charset and collate"}, {ActionDropIndexes, "drop multi-indexes"}, {ActionAlterTablePlacement, "alter table placement"}, - {ActionAlterTablePartitionPolicy, "alter table partition policy"}, + {ActionAlterTablePartitionPlacement, "alter table partition placement"}, {ActionAlterNoCacheTable, "alter table nocache"}, }