code: func convertStringToDuration(sc *stmtctx.StatementContext, str string, fsp int) (d types.Duration, t types.Time,
  	isDuration bool, err error) {
  	if n := strings.IndexByte(str, '.'); n >= 0 {
  		lenStrFsp := len(str[n+1:])
  		if lenStrFsp <= types.MaxFsp {
  			fsp = mathutil.Max(lenStrFsp, fsp)
  		}
  	}
  	return types.StrToDuration(sc, str, fsp)
  }
docs: // convertStringToDuration converts string to duration, it return types.Time because in some case
  // it will converts string to datetime.