Bug #16793 Cluster: errno: 140 returned on create with BIT as part of Primary Key
Submitted: 26 Jan 2006 2:42 Modified: 17 Feb 2006 13:03
Reporter: Jonathan Miller Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.1.6-alpha OS:Linux (Linux)
Assigned to: Jon Stephens CPU Architecture:Any

[26 Jan 2006 2:42] Jonathan Miller
Description:
mysqltest: At line 56: query 'CREATE TABLE test.t2 (
c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
c2 TEXT NOT NULL,
c3 INT NOT NULL,
c4 BIT NOT NULL,
c5 DECIMAL(8,3),
c6 LONGBLOB,
PRIMARY KEY(c1,c4))
TABLESPACE range_ts2 STORAGE DISK ENGINE=NDB
PARTITION BY RANGE (c1)
PARTITIONS 3 (
PARTITION x1 VALUES LESS THAN (200),
PARTITION x2 VALUES LESS THAN (400),
PARTITION x3 VALUES LESS THAN (600))' failed: 1005: Can't create table 'test.t2' (errno: 140)
(the last lines may be the most important ones)

How to repeat:
See above

Suggested fix:
Either support bit as part of multi PK or return error message telling of the infraction
[6 Feb 2006 10:19] Jonas Oreland
1) ndb does not support bit field as primary key (neither as single pk, nor composite)
2) I think that error messages are ok.
3) I'm not sure that it's in the documentation

Conclusion: Documenting

mysql> create table t1 (a bit(1) primary key);
ERROR 1005 (HY000): Can't create table 'test.t1' (errno: 140)
mysql> show warnings;
+-------+------+---------------------------------------------------------+
| Level | Code | Message                                                 |
+-------+------+---------------------------------------------------------+
| Error | 1296 | Got error 739 'Unsupported primary key length' from NDB |
| Error | 1005 | Can't create table 'test.t1' (errno: 140)               |
+-------+------+---------------------------------------------------------+
2 rows in set (0.00 sec)

mysql> Aborted
jonas@perch:~/run/2-node/api.6> perror 140
MySQL error code 140: Wrong create options
[6 Feb 2006 23:55] Mike Hillyer
Documenting status is just for flagging that a bug needs a changelog entry, changing status to Verified and assigning to Jon Stephens.
[7 Feb 2006 10:16] Jon Stephens
Um, no.

"Documenting" means this needs to be documented. 

Since this is a bug against the docs, there's no changelog entry to be made.
That doesn't alter the fact that it needs to be documented, hence Status should
be "Documenting".
[8 Feb 2006 7:31] Jon Stephens
Discussed with M Hillyer - setting category/status to Docs/Verified is the way to handle these cases. My bad.
[17 Feb 2006 13:03] 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
product(s).

Additional info:

Updated Cluster Limitations section in 4.1/5.0/5.1 RefMan with supplied info. Closed.