[MDEV-13640] ALTER TABLE CHANGE and ADD INDEX on auto_increment column fails with "Incorrect key file for table..." Created: 2017-08-24 Updated: 2020-08-25 Resolved: 2018-01-18 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table, Storage Engine - InnoDB, Storage Engine - XtraDB |
| Affects Version/s: | 10.0, 10.1, 10.3.0, 10.1.26, 10.0.32, 10.2.8, 10.2 |
| Fix Version/s: | 10.0.33, 10.1.30, 10.2.12, 10.3.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Chris Calender (Inactive) | Assignee: | Jan Lindström (Inactive) |
| Resolution: | Fixed | Votes: | 2 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Sprint: | 10.0.34 | ||||||||||||||||||||||||
| Description |
|
An ALTER TABLE CHANGE and ADD INDEX on auto_increment column fails with "Incorrect key file for table...".
|
| Comments |
| Comment by Elena Stepanova [ 2017-08-24 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The error started happening in 10.0 after this fix:
Before that, the same query caused the crash. The crash started happening not long before that, between 10.0.23 and 10.0.24. In 10.0.23 and earlier, the query works okay. Also reproducible on current 10.1, 10.2, 10.3. Not reproducible on MySQL 5.6, 5.7. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Arnaud Adant [ 2017-08-25 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The workaround is to alter the table in 2 steps. MariaDB [test]> CREATE TABLE t ( MariaDB [test]> ALTER TABLE t CHANGE a b BIGINT UNSIGNED NOT NULL AUTO_INCREMENT; MariaDB [test]> ALTER TABLE t ADD KEY uk (c); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-08-29 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I filed While doing that, I filed | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Arnaud Adant [ 2017-09-01 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks Marko | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-09-08 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
When merging the test innodb.alter_crash from 5.7 to 10.2, I ran into the
Edit: The reason turned out to be that ENGINE=MyISAM was implied in a CREATE TABLE statement that lacked explicit ENGINE=InnoDB. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2018-01-18 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Fixed on
|