According to MySQL, a text column holds 65,535 bytes.
So if this a legitimate boundary then will it actually only fit about 32k UTF-8 characters, right?
However, when used as primary key, MySQL assumes that each limit of column's size adds 3 bytes to key.
mysql> alter table test2 modify code varchar(333) character set utf8;
Query OK, 0 rows affected (0.05 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> alter table test2 modify code varchar(334) character set utf8;
ERROR 1071 (42000): Specified key was too long; max key length is 1000 bytes
Well, using long string columns as primary key is generally a bed practice, however I've came across that problem when working with database of one commercial (!) product.