Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: Rename some names of placement ddl operation #30622

Merged
merged 5 commits into from
Dec 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion br/pkg/backup/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion ddl/ddl_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
}
Expand Down
4 changes: 2 additions & 2 deletions ddl/ddl_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion ddl/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down
2 changes: 1 addition & 1 deletion executor/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions parser/model/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion parser/model/model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
}

Expand Down