[MDEV-13668] InnoDB unnecessarily rebuilds table when renaming a column and adding index Created: 2017-08-29 Updated: 2022-08-31 Resolved: 2018-01-18 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB, Storage Engine - XtraDB |
| Affects Version/s: | 10.0.24, 10.1.12, 10.2.0, 10.3.0 |
| Fix Version/s: | 10.0.33, 10.1.30, 10.2.12, 10.3.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Jan Lindström (Inactive) |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | compat56, ddl, performance | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||
| Description |
|
A code change that was introduced to address The commit comment incorrectly claims that when a column is renamed and a secondary index is added, the whole table must be rebuilt. Because of this bug, the MySQL 5.6 test innodb.innodb-alter fails in MariaDB 10.0 as follows:
When the failing statement is executed, the table contains two FULLTEXT indexes on the same column. In MySQL 5.6, renaming the column from c2 to c4 and adding a secondary index on the renamed column will work just fine. The InnoDB in MariaDB unnecessarily insists that the table be rebuilt. To add insult to the injury, MariaDB inherits the MySQL InnoDB limitation that creating FULLTEXT indexes is not possible with LOCK=NONE. So, the whole ALTER TABLE operation has to be done while writes to the table are prohibited. |
| Comments |
| Comment by Marko Mäkelä [ 2017-08-29 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The same problem is repeated in innodb.innodb-wl5980-alter. The test innodb.innodb-alter is also demonstrating some other problems, including what looks like a duplicate of | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-09-21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
As part of fixing this, I think that we must carefully review the changes to the inplace_alter_table functions between MySQL 5.6 and MariaDB 10.0/10.1 as well as MySQL 5.7 and MariaDB 10.2. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2018-01-18 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Fixed on:
|