9.1.4 Hexadecimal Literals

MySQL supports hexadecimal values, written using
X'val',
x'val', or
0xval format,
where val contains hexadecimal digits
(0..9, A..F). Lettercase
of the digits does not matter. For values written using
X'val' or
x'val' format,
val must contain an even number of
digits. For values written using
0xval syntax,
values that contain an odd number of digits are treated as
having an extra leading 0. For example,
0x0a and 0xaaa are
interpreted as 0x0a and
0x0aaa.

In numeric contexts, hexadecimal values act like integers
(64-bit precision). In string contexts, they act like binary
strings, where each pair of hex digits is converted to a
character: