Bug #52615 Manual incorrectly states limit of 31 bytes for table attributes
Submitted: 6 Apr 2010 9:27 Modified: 7 Apr 2010 6:39
Reporter: Geert Vanderkelen Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:mysql-5.1-telco-7.0 OS:Any
Assigned to: Jon Stephens CPU Architecture:Any
Tags: Docs

[6 Apr 2010 9:27] Geert Vanderkelen
Description:
Following URL:
 http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-limitations-database-objects.html

It mentions that attribute name length can not be bigger as 31 bytes. This probably an old limitation, at it is perfectly possible to create a column name having 64 characters (which is the MySQL limit).

That chapter probably needs some serious revamping.

How to repeat:
DROP TABLE IF EXISTS t1;
-- This works:
SELECT REPEAT ('a',64);
CREATE TABLE t1 ( `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` INT KEY) ENGINE=NDBCluster;
-- This correctly fails:
DROP TABLE IF EXISTS t1;
SELECT REPEAT ('a',65);
CREATE TABLE t1 ( `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` INT KEY) ENGINE=NDBCluster;

To demonstrate this is 64 characters, and not bytes, some unicode tricks (we don't use it as PK because bug#52613):
DROP TABLE IF EXISTS t1;
-- This works:
SELECT REPEAT ('♔',64);
CREATE TABLE t1 (id INT KEY, `♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔` INT) ENGINE=NDBCluster;
-- This correctly fails:
SELECT REPEAT ('♔',65);
CREATE TABLE t1 (id INT KEY, `♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔` INT) ENGINE=NDBCluster;
[6 Apr 2010 9:28] Geert Vanderkelen
Verified using MySQL Cluster 7.0.14.
[6 Apr 2010 10:28] Geert Vanderkelen
For the Row Size: it's not 8Kb, it's 8052 bytes.
This can be gathered from the Error Message (using 7.0):

ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8052. You have to change some columns to TEXT or BLOBs
[6 Apr 2010 13:30] Jon Stephens
Set lead.
[6 Apr 2010 14:08] Jon Stephens
Set Category.
[7 Apr 2010 6:39] Jon Stephens
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.