docs/en/sql-reference/sql-functions/string-functions/hex_decode_binary.md
Decodes a hex encoded string to a binary.
This function is supported from v3.0.
hex_decode_binary(str);
str: the string to convert. The supported data type is VARCHAR.
An empty binary is returned if any of the following situations occur:
[0-9], [a-z], and [A-Z].Returns a value of the VARBINARY type.
mysql> select hex(hex_decode_binary(hex("Hello StarRocks")));
+------------------------------------------------+
| hex(hex_decode_binary(hex('Hello StarRocks'))) |
+------------------------------------------------+
| 48656C6C6F2053746172526F636B73 |
+------------------------------------------------+
mysql> select hex_decode_binary(NULL);
+--------------------------------------------------+
| hex_decode_binary(NULL) |
+--------------------------------------------------+
| NULL |
+--------------------------------------------------+
HEX_DECODE_BINARY