code: func StrToDuration(sc *stmtctx.StatementContext, str string, fsp int) (d Duration, t Time, isDuration bool, err error) {
  	str = strings.TrimSpace(str)
  	length := len(str)
  	if length > 0 && str[0] == '-' {
  		length--
  	}
  	// Timestamp format is 'YYYYMMDDHHMMSS' or 'YYMMDDHHMMSS', which length is 12.
  	// See #3923, it explains what we do here.
  	if length >= 12 {
  		t, err = StrToDateTime(sc, str, fsp)
  		if err == nil {
  			return d, t, false, nil
  		}
  	}
  
  	d, err = ParseDuration(sc, str, fsp)
  	if ErrTruncatedWrongVal.Equal(err) {
  		err = sc.HandleTruncate(err)
  	}
  	return d, t, true, errors.Trace(err)
  }
docs: // StrToDuration converts str to Duration. It returns Duration in normal case,
  // and returns Time when str is in datetime format.
  // when isDuration is true, the d is returned, when it is false, the t is returned.
  // See https://dev.mysql.com/doc/refman/5.5/en/date-and-time-literals.html.