Description:
With introducing 4-byte utf8 character set (WL#1213) maximum
possible key length changed from 255 to 191 characters.
So some dumps created in a pre-WL#1213 version will fail to load.
How to repeat:
This can currently be demonstrated in mysql-6.1-glob tree,
but WL#1213 will also be in 5.5 (Celosia) soon:
In mysql-6.1-glob I get the following:
-- varchar(191) works fine
mysql> drop table if exists t1; create table t1 (a varchar(191) primary key) engine=innodb character set utf8; show create table t1;
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.01 sec)
+-------+-----------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-----------------------------------------------------------------------------------------------------------+
| t1 | CREATE TABLE `t1` (
`a` varchar(191) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
+-------+-----------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
-- varchar(192) or longer fails
mysql> drop table if exists t1; create table t1 (a varchar(192) primary key) engine=innodb character set utf8; show create table t1;
Query OK, 0 rows affected (0.00 sec)
ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes
ERROR 1146 (42S02): Table 'test.t1' doesn't exist
mysql>
Suggested fix:
Fix this definition in include/rem0types.h:
#define REC_MAX_INDEX_COL_LEN 768
to
#define REC_MAX_INDEX_COL_LEN 1024
to make the above CREATE statement work up to varchar(255).