How MySQL evaluates an empty hexadecimal value?

MySQLMySQLi Database

Actually, MySQL evaluates an empty hexadecimal value to a zero-length binary string. It can be demonstrated as follows −

mysql> Select CHARSET(X'');
+--------------+
| CHARSET(X'') |
+--------------+
| binary       |
+--------------+
1 row in set (0.00 sec)

The above result set shows that the empty hexadecimal value is a binary string. And the result set below shows that it is of length 0.

mysql> Select LENGTH(X'');
+-------------+
| LENGTH(X'') |
+-------------+
| 0           |
+-------------+
1 row in set (0.00 sec)
raja
Published on 20-Feb-2018 13:22:19
Advertisements