Description:
CHAR holds non-binary strings and BINARY holds binary
strings, but other than that, the two column types are
similar in most ways.
However, there is one inconsistency in how columns of
the two types can be declared. CHAR can be declared
without a length, and becomes CHAR(1). BINARY cannot
be declared without a length. An error occurs if you try
it.
How to repeat:
mysql> CREATE TABLE t1 (c CHAR);
Query OK, 0 rows affected (0.01 sec)
mysql> SHOW CREATE TABLE t1\G
*************************** 1. row ***************************
Table: t1
Create Table: CREATE TABLE `t1` (
`c` char(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1 row in set (0.00 sec)
mysql> CREATE TABLE t2 (b BINARY);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near ')' at line 1
Suggested fix:
Allow BINARY without a length to be used as a
synonym for BINARY(1).