Bug #13596 Server allows PRIMARY KEY > 500 for MyISAM when failing over from InnoDB

Submitted: 29 Sep 2005 7:09 Modified: 24 Apr 2006 9:12
Reporter: Lachlan Mulcahy Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0.26 OS:Any (Any)
Assigned to: Sergey Vojtovich CPU Architecture:Any

[29 Sep 2005 7:09] Lachlan Mulcahy
Description:
When running MySQL with skip-innodb if you attempt to create a table with a primary key that exceeds 500 in length and specify InnoDB as the TYPE parameter the server will failover to MyISAM and create the table even though it should issue an error due to index length being > 500.

I'm not sure what the impact of the server allowing this is; perhaps it could cause corrupted indexes  when the table is used?

How to repeat:
Start server with skip-innodb

# This will issue and error (key > 500)
CREATE TABLE t1 (a VARCHAR(255), b VARCHAR(255), PRIMARY KEY(a,b) ) TYPE=MyISAM;

# This will not issue an error and will create a MyISAM table
CREATE TABLE t1 (a VARCHAR(255), b VARCHAR(255), PRIMARY KEY(a,b) ) TYPE=InnoDB;

# Check for MyISAM table with index > 500
SHOW TABLE STATUS LIKE 't1';
SHOW INDEX FROM t1;

Suggested fix:
Perform complete checks on new table for table types when "failing over".
[24 Apr 2006 9:12] Sergey Vojtovich
This bug doesn't occur in 4.1, 5.0. 4.0 is closed for development. Setting bug status to Won't fix.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.061 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.