Description:
MyISAM allows index prefixes to be up to 1000 bytes, and longer prefixes generate a warning. But whereas in 5.0 one warning, in 5.1 and 6.0, two and three identical warnings are generated, respectively!
How to repeat:
Test script:
drop table if exists t;
create table t (b blob);
alter table t add index (b(1001));
show warnings;
Result in 5.0.52:
+---------+------+----------------------------------------------------------+
| Level | Code | Message |
+---------+------+----------------------------------------------------------+
| Warning | 1071 | Specified key was too long; max key length is 1000 bytes |
+---------+------+----------------------------------------------------------+
Result in 5.1.23:
+---------+------+----------------------------------------------------------+
| Level | Code | Message |
+---------+------+----------------------------------------------------------+
| Warning | 1071 | Specified key was too long; max key length is 1000 bytes |
| Warning | 1071 | Specified key was too long; max key length is 1000 bytes |
+---------+------+----------------------------------------------------------+
Result in 6.0.4:
+---------+------+----------------------------------------------------------+
| Level | Code | Message |
+---------+------+----------------------------------------------------------+
| Warning | 1071 | Specified key was too long; max key length is 1000 bytes |
| Warning | 1071 | Specified key was too long; max key length is 1000 bytes |
| Warning | 1071 | Specified key was too long; max key length is 1000 bytes |
+---------+------+----------------------------------------------------------+
Suggested fix:
I think a single warning should be sufficient. :-)