code: func ParseHexStr(s string) (BinaryLiteral, error) {
  	if len(s) == 0 {
  		return nil, errors.Errorf("invalid empty string for parsing hexadecimal literal")
  	}
  
  	if s[0] == 'x' || s[0] == 'X' {
  		// format is x'val' or X'val'
  		s = strings.Trim(s[1:], "'")
  		if len(s)%2 != 0 {
  			return nil, errors.Errorf("invalid hexadecimal format, must even numbers, but %d", len(s))
  		}
  	} else if strings.HasPrefix(s, "0x") {
  		s = s[2:]
  	} else {
  		// here means format is not x'val', X'val' or 0xval.
  		return nil, errors.Errorf("invalid hexadecimal format %s", s)
  	}
  
  	if len(s) == 0 {
  		return ZeroBinaryLiteral, nil
  	}
  
  	if len(s)%2 != 0 {
  		s = "0" + s
  	}
  	buf, err := hex.DecodeString(s)
  	if err != nil {
  		return nil, errors.Trace(err)
  	}
  	return buf, nil
  }
docs: // ParseHexStr parses hexadecimal string literal.
  // See https://dev.mysql.com/doc/refman/5.7/en/hexadecimal-literals.html