Skip to content

Commit

Permalink
update code
Browse files Browse the repository at this point in the history
Signed-off-by: joccau <[email protected]>
  • Loading branch information
joccau committed Sep 21, 2024
1 parent 3e2aa18 commit f9e7f70
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions pkg/ddl/modify_column.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,10 @@ func rollbackModifyColumnJob(jobCtx *jobContext, t *meta.Meta, tblInfo *model.Ta
}
job.FinishTableJob(model.JobStateRollbackDone, model.StateNone, ver, tblInfo)
// For those column-type-change type which doesn't need reorg data, we should also mock the job args for delete range.
job.Args = []any{[]int64{}, []int64{}}
job.FillFinishedArgs(&model.ModifyColumnArgs{
IndexIDs: []int64{},
PartitionIDs: []int64{},
})
return ver, nil
}

Expand Down Expand Up @@ -258,7 +261,10 @@ func rollbackModifyColumnJobWithData(
}
job.FinishTableJob(model.JobStateRollbackDone, model.StateNone, ver, tblInfo)
// Reconstruct the job args to add the temporary index ids into delete range table.
job.Args = []any{changingIdxIDs, getPartitionIDs(tblInfo)}
job.FillFinishedArgs(&model.ModifyColumnArgs{
IndexIDs: changingIdxIDs,
PartitionIDs: getPartitionIDs(tblInfo),
})
return ver, nil
}

Expand Down Expand Up @@ -317,7 +323,10 @@ func (w *worker) doModifyColumn(

job.FinishTableJob(model.JobStateDone, model.StatePublic, ver, tblInfo)
// For those column-type-change type which doesn't need reorg data, we should also mock the job args for delete range.
job.Args = []any{[]int64{}, []int64{}}
job.FillFinishedArgs(&model.ModifyColumnArgs{
IndexIDs: []int64{},
PartitionIDs: []int64{},
})
return ver, nil
}

Expand Down

0 comments on commit f9e7f70

Please sign in to comment.