SQL Server crashes when altering a table with multi-key index -- OSX build 5.6.13
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
MySQL Server |
Unknown
|
Unknown
|
||||
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.1 |
Invalid
|
Undecided
|
Unassigned | |||
5.5 |
Invalid
|
Undecided
|
Unassigned | |||
5.6 |
Incomplete
|
High
|
Unassigned | |||
5.7 |
Incomplete
|
High
|
Unassigned |
Bug Description
When I execute the following code on percona v 5.6.13, I consistently get the server to crash -- I've attached a logfile showing the crash. Every once in awhile when I run it, it doesn't crash, but I always still get the ERROR's at the top of the logfile, that seem to indicate the origin of the bug. Note that this is done with a clean database, and empty table -- I drop / create the table right at the start. Should be easy to reproduce on OSX -- it appears to work fine on an ubuntu 12.04 percona install v 5.6.15.
drop table if exists sometable;
CREATE TABLE sometable
( key1 INT UNSIGNED NOT NULL
, key2 INT UNSIGNED DEFAULT NULL
, key3 CHAR(20) NOT NULL
, data CHAR(80) NOT NULL
, UNIQUE KEY key3_key1_key2 (key3, key1, key2)
, KEY (key1)
, KEY (key2)
, KEY (key3)
) ENGINE=InnoDB;
ALTER TABLE sometable MODIFY key2 INT UNSIGNED NOT NULL DEFAULT 0;
SELECT data FROM sometable WHERE key1 = 1 AND key3 = 3 AND key2 = 2;
I see the same error messages with upstream 5.6.17 on Windows:
2014-05-18 17:46:30 5396 [Note] C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld: ready for connections. dev.mysql. com/doc/ refman/ 5.6/en/ innodb- troubleshooting .html
Version: '5.6.17-log' socket: '' port: 3314 MySQL Community Server (GPL)
2014-05-29 09:30:15 5396 [ERROR] Table .\test\sometable has no primary key in InnoDB data dictionary, but has one in MySQL! If you created the table with a MySQL version < 3.23.54 and did not define a primary key, but defined a unique key with all non-NULL columns, then MySQL internally treats that key as the primary key. You can fix this error by dump + DROP + CREATE + reimport of the table.
2014-05-29 09:30:15 5396 [Warning] Table .\test\sometable key_used_on_scan is 0 even though there is no primary key inside InnoDB.
2014-05-29 09:30:15 5396 [ERROR] Index key1 of test/sometable has 2 columns unique inside InnoDB, but MySQL is asking statistics for 3 columns. Have you mixed up .frm files from different installations? See http://
2014-05-29 09:30:15 5396 [ERROR] Index key2 of test/sometable has 2 columns unique inside InnoDB, but MySQL is asking statistics for 3 columns. Have you mixed up .frm files from different installations? See http:// dev.mysql. com/doc/ refman/ 5.6/en/ innodb- troubleshooting .html
2014-05-29 09:30:15 5396 [ERROR] Index key3 of test/sometable has 2 columns unique inside InnoDB, but MySQL is asking statistics for 3 columns. Have you mixed up .frm files from different installations? See http:// dev.mysql. com/doc/ refman/ 5.6/en/ innodb- troubleshooting .html
and server seems to hang for SELECT and even crash there when running EXPLAIN SELECT ...
So, I think this is upstream MySQL bug. Will you report it to http:// bugs.mysql. com (to get a credit) or should I do this for you?