MySQL Synonym of the day: LONG is MEDIUMTEXT

To me a LONG would be an integer. MySQL, however, defines it as a synonym for MEDIUMTEXT. So careful porting those projects to or from MySQL!

mysql> CREATE TABLE a (id LONG);
mysql> SHOW CREATE TABLE a\G
..
Create Table: CREATE TABLE `a` (
  `id` mediumtext
) ENGINE=MyISAM DEFAULT CHARSET=latin1

A bug has been opened for documenting, but it is actually documented here.

Comments

Roland Bouman
Hi!

LONG is what was used in Oracle, in the olden days before it had proper blobs/clobs. If i recal correctly, it corresponded to a max. 2GB string (at least in Oracle 7).