Bug #32475 ALTER TABLE: too many warnings on index creation
Submitted: 18 Nov 2007 3:16 Modified: 8 Oct 2008 19:37
Reporter: Paul DuBois Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Errors Severity:S3 (Non-critical)
Version:5.1, 6.0 OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[18 Nov 2007 3:16] Paul DuBois
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. :-)
[18 Nov 2007 10:09] MySQL Verification Team
Thank you for the bug report. Verified as described.
[8 Oct 2008 19:37] Konstantin Osipov
Duplicate of Bug#31149