Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
mjonss committed Apr 10, 2023
1 parent 545a313 commit cb3020b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 5 additions & 2 deletions ddl/partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -2318,9 +2318,9 @@ func (w *worker) onAlterTablePartitioning(d *ddlCtx, t *meta.Meta, job *model.Jo
physicalTableIDs := getPartitionIDsFromDefinitions(tblInfo.Partition.DroppingDefinitions)
newIDs := getPartitionIDsFromDefinitions(partInfo.Definitions)
job.CtxVars = []interface{}{physicalTableIDs, newIDs}
oldTblId := tblInfo.ID
oldTblID := tblInfo.ID
// If no global index this is not really needed?
physicalTableIDs = append(physicalTableIDs, oldTblId)
physicalTableIDs = append(physicalTableIDs, oldTblID)
err = t.DropTableOrView(job.SchemaID, tblInfo.ID)
if err != nil {
job.State = model.JobStateCancelled
Expand All @@ -2346,6 +2346,9 @@ func (w *worker) onAlterTablePartitioning(d *ddlCtx, t *meta.Meta, job *model.Jo
tblInfo.Partition.NewTableID = 0

err = t.CreateTableOrView(job.SchemaID, tblInfo)
if err != nil {
return ver, errors.Trace(err)
}
ver, err = updateVersionAndTableInfo(d, t, job, tblInfo, true)
failpoint.Inject("reorgPartWriteReorgSchemaVersionUpdateFail", func(val failpoint.Value) {
if val.(bool) {
Expand Down
7 changes: 4 additions & 3 deletions parser/model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -1113,14 +1113,15 @@ type PartitionType int

// Partition types.
const (
// Actually non-partitioned, but during DDL keeping the table as
// a single partition
PartitionTypeNone PartitionType = 0

PartitionTypeRange PartitionType = 1
PartitionTypeHash PartitionType = 2
PartitionTypeList PartitionType = 3
PartitionTypeKey PartitionType = 4
PartitionTypeSystemTime PartitionType = 5
// Actually non-partitioned, but during DDL keeping the table as
// a single partition
PartitionTypeNone PartitionType = 6
)

func (p PartitionType) String() string {
Expand Down

0 comments on commit cb3020b

Please sign in to comment.