How 0x00-padding of BINARY values affects column value comparisons : Hexadecimal : Data Types MySQL TUTORIALS


MySQL TUTORIALS » Data Types » Hexadecimal »

 

How 0x00-padding of BINARY values affects column value comparisons


mysql>
mysql> CREATE TABLE myTable (c BINARY(3));
Query OK, rows affected (0.03 sec)

mysql>
mysql> INSERT INTO myTable SET c = 'a';
Query OK, row affected (0.00 sec)

mysql>
mysql> SELECT HEX(c), c = 'a', c = 'a00' from myTable;
+--------+---------+-------------+
| HEX(c| c = 'a' | c = 'a00' |
+--------+---------+-------------+
610000 |       |           |
+--------+---------+-------------+
row in set (0.00 sec)

mysql>
mysql> drop table myTable;
Query OK, rows affected (0.00 sec)

mysql>
mysql>



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Data Types
» Hexadecimal