Bug #78927 Can't create index on big columns: Specified key was too long
Submitted: 22 Oct 2015 17:44 Modified: 3 Nov 2015 18:09
Reporter: Odis Yuck Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S2 (Serious)
Version:5.6.23-ndb-7.4.5-cluster-gpl OS:CentOS (may be other too)
Assigned to: CPU Architecture:Any

[22 Oct 2015 17:44] Odis Yuck
Description:
According to documentation if I want to create index on big column cluster will index only 3072 bytes and will show me warning. It shows me error instead and I can't choose length of index (see "How to repeat").

How to repeat:
mysql> create table test_bug(test varchar(4096) character set utf8);
Query OK, 0 rows affected (0,22 sec)

mysql> alter table test_bug add key test_key(test(10));
ERROR 1071 (42000): Specified key was too long; max key length is 3072 bytes

mysql> create table test_bug1(test varchar(4096) character set ascii);
Query OK, 0 rows affected (0,15 sec)

mysql> alter table test_bug1 add key test_key(test);
ERROR 1071 (42000): Specified key was too long; max key length is 3072 bytes
mysql> alter table test_bug1 add key test_key(test(10));
ERROR 1071 (42000): Specified key was too long; max key length is 3072 bytes
mysql> alter table test_bug1 add key test_key(test(3072));
ERROR 1071 (42000): Specified key was too long; max key length is 3072 bytes
[22 Oct 2015 17:53] Odis Yuck
Url to documentation: https://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-limitations-syntax.html

>Column width. Attempting to create an index on an NDB table column whose width is greater than 3072 bytes succeeds, but only the first 3072 bytes are actually used for the index. In such cases, a warning Specified key was too long; max key length is 3072 bytes is issued, and a SHOW CREATE TABLE statement shows the length of the index as 3072.
[3 Nov 2015 18:09] MySQL Verification Team
Hi,

Thanks for the bug report. Verified as described

all best
Bogdan Kecman