code: func onTruncateTablePartition(t *meta.Meta, job *model.Job) (int64, error) {
  	var ver int64
  	var oldID int64
  	if err := job.DecodeArgs(&oldID); err != nil {
  		job.State = model.JobStateCancelled
  		return ver, errors.Trace(err)
  	}
  	tblInfo, err := getTableInfoAndCancelFaultJob(t, job, job.SchemaID)
  	if err != nil {
  		return ver, errors.Trace(err)
  	}
  	pi := tblInfo.GetPartitionInfo()
  	if pi == nil {
  		return ver, errors.Trace(ErrPartitionMgmtOnNonpartitioned)
  	}
  
  	var find bool
  	for i := 0; i < len(pi.Definitions); i++ {
  		def := &pi.Definitions[i]
  		if def.ID == oldID {
  			pid, err1 := t.GenGlobalID()
  			if err != nil {
  				return ver, errors.Trace(err1)
  			}
  			def.ID = pid
  			find = true
  			break
  		}
  	}
  	if !find {
  		return ver, table.ErrUnknownPartition.GenWithStackByArgs("drop?", tblInfo.Name.O)
  	}
  
  	ver, err = updateVersionAndTableInfo(t, job, tblInfo, true)
  	if err != nil {
  		return ver, errors.Trace(err)
  	}
  
  	// Finish this job.
  	job.FinishTableJob(model.JobStateDone, model.StateNone, ver, tblInfo)
  	// A background job will be created to delete old partition data.
  	job.Args = []interface{}{oldID}
  	return ver, nil
  }
docs: // onDropTablePartition truncates old partition meta.