Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
tangenta committed Apr 28, 2022
1 parent 99a6ee4 commit d539d8d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ddl/column.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ func onDropColumn(d *ddlCtx, t *meta.Meta, job *model.Job) (ver int64, _ error)
job.Args = append(job.Args, getPartitionIDs(tblInfo))
}
default:
err = dbterror.ErrInvalidDDLJob.GenWithStackByArgs("table", tblInfo.State)
return ver, errors.Trace(dbterror.ErrInvalidDDLJob.GenWithStackByArgs("table", tblInfo.State))
}
job.SchemaState = colInfo.State
return ver, errors.Trace(err)
Expand Down
2 changes: 1 addition & 1 deletion ddl/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ func onDropIndex(d *ddlCtx, t *meta.Meta, job *model.Job) (ver int64, _ error) {
job.Args = append(job.Args, indexInfo.ID, getPartitionIDs(tblInfo))
}
default:
return ver, dbterror.ErrInvalidDDLState.GenWithStackByArgs("index", indexInfo.State)
return ver, errors.Trace(dbterror.ErrInvalidDDLState.GenWithStackByArgs("index", indexInfo.State))
}
job.SchemaState = indexInfo.State
return ver, errors.Trace(err)
Expand Down
2 changes: 1 addition & 1 deletion ddl/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func onDropSchema(d *ddlCtx, t *meta.Meta, job *model.Job) (ver int64, _ error)
job.FinishDBJob(model.JobStateDone, model.StateNone, ver, dbInfo)
default:
// We can't enter here.
err = errors.Errorf("invalid db state %v", dbInfo.State)
return ver, errors.Trace(errors.Errorf("invalid db state %v", dbInfo.State))
}
job.SchemaState = dbInfo.State
return ver, errors.Trace(err)
Expand Down
8 changes: 4 additions & 4 deletions ddl/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,14 +309,14 @@ func onDropTableOrView(d *ddlCtx, t *meta.Meta, job *model.Job) (ver int64, _ er
}
if tblInfo.IsSequence() {
if err = t.DropSequence(job.SchemaID, job.TableID); err != nil {
break
return ver, errors.Trace(err)
}
} else {
if err = t.DropTableOrView(job.SchemaID, job.TableID); err != nil {
break
return ver, errors.Trace(err)
}
if err = t.GetAutoIDAccessors(job.SchemaID, job.TableID).Del(); err != nil {
break
return ver, errors.Trace(err)
}
}
// Placement rules cannot be removed immediately after drop table / truncate table, because the
Expand All @@ -327,7 +327,7 @@ func onDropTableOrView(d *ddlCtx, t *meta.Meta, job *model.Job) (ver int64, _ er
startKey := tablecodec.EncodeTablePrefix(job.TableID)
job.Args = append(job.Args, startKey, oldIDs, ruleIDs)
default:
err = dbterror.ErrInvalidDDLState.GenWithStackByArgs("table", tblInfo.State)
return ver, errors.Trace(dbterror.ErrInvalidDDLState.GenWithStackByArgs("table", tblInfo.State))
}
job.SchemaState = tblInfo.State
return ver, errors.Trace(err)
Expand Down

0 comments on commit d539d8d

Please sign in to comment.