code: func (t Time) RoundFrac(sc *stmtctx.StatementContext, fsp int) (Time, error) {
  	if t.Type == mysql.TypeDate || t.IsZero() {
  		// date type has no fsp
  		return t, nil
  	}
  
  	fsp, err := CheckFsp(fsp)
  	if err != nil {
  		return t, errors.Trace(err)
  	}
  
  	if fsp == t.Fsp {
  		// have same fsp
  		return t, nil
  	}
  
  	var nt MysqlTime
  	if t1, err := t.Time.GoTime(sc.TimeZone); err == nil {
  		t1 = roundTime(t1, fsp)
  		nt = FromGoTime(t1)
  	} else {
  		// Take the hh:mm:ss part out to avoid handle month or day = 0.
  		hour, minute, second, microsecond := t.Time.Hour(), t.Time.Minute(), t.Time.Second(), t.Time.Microsecond()
  		t1 := gotime.Date(1, 1, 1, hour, minute, second, microsecond*1000, gotime.Local)
  		t2 := roundTime(t1, fsp)
  		hour, minute, second = t2.Clock()
  		microsecond = t2.Nanosecond() / 1000
  
  		// TODO: when hh:mm:ss overflow one day after rounding, it should be add to yy:mm:dd part,
  		// but mm:dd may contain 0, it makes the code complex, so we ignore it here.
  		if t2.Day()-1 > 0 {
  			return t, errors.Trace(ErrInvalidTimeFormat.GenWithStackByArgs(t.String()))
  		}
  		nt = FromDate(t.Time.Year(), t.Time.Month(), t.Time.Day(), hour, minute, second, microsecond)
  	}
  
  	return Time{Time: nt, Type: t.Type, Fsp: fsp}, nil
  }
docs: // RoundFrac rounds the fraction part of a time-type value according to `fsp`.