예제 #1
0
파일: bg_worker.go 프로젝트: XuHuaiyu/tidb
// prepareBgJob prepares a background job.
func (d *ddl) prepareBgJob(t *meta.Meta, ddlJob *model.Job) error {
	job := &model.Job{
		ID:       ddlJob.ID,
		SchemaID: ddlJob.SchemaID,
		TableID:  ddlJob.TableID,
		Type:     ddlJob.Type,
		Args:     ddlJob.Args,
	}
	err := t.EnQueueBgJob(job)
	return errors.Trace(err)
}
예제 #2
0
파일: bg_worker.go 프로젝트: jmptrader/tidb
// prepareBgJob prepares a background job.
func (d *ddl) prepareBgJob(t *meta.Meta, ddlJob *model.Job) error {
	job := &model.Job{
		ID:       ddlJob.ID,
		SchemaID: ddlJob.SchemaID,
		TableID:  ddlJob.TableID,
		Type:     ddlJob.Type,
	}

	if len(ddlJob.Args) >= 2 {
		// ddlJob.Args[0] is the schema version that isn't necessary in background job and
		// ddlJob.Args[1] is the table information or the database information.
		// They will make the background job of dropping schema become more complicated to handle.
		job.Args = ddlJob.Args[2:]
	}

	err := t.EnQueueBgJob(job)
	return errors.Trace(err)
}