code: func GetHistoryDDLJobs(txn kv.Transaction, maxNumJobs int) ([]*model.Job, error) {
  	t := meta.NewMeta(txn)
  	jobs, err := t.GetAllHistoryDDLJobs()
  	if err != nil {
  		return nil, errors.Trace(err)
  	}
  
  	jobsLen := len(jobs)
  	if jobsLen > maxNumJobs {
  		start := jobsLen - maxNumJobs
  		jobs = jobs[start:]
  	}
  	jobsLen = len(jobs)
  	ret := make([]*model.Job, 0, jobsLen)
  	for i := jobsLen - 1; i >= 0; i-- {
  		ret = append(ret, jobs[i])
  	}
  	return ret, nil
  }
docs: // GetHistoryDDLJobs returns the DDL history jobs and an error.
  // The maximum count of history jobs is num.