Fast index creation fails with DROP/ADD index
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS |
Fix Released
|
Medium
|
Hrvoje Matijakovic | ||
5.1 |
Fix Released
|
Medium
|
Hrvoje Matijakovic | ||
5.5 |
Fix Released
|
Medium
|
Hrvoje Matijakovic |
Bug Description
show create table sbtest1;
+------
| Table | Create Table |
+------
| sbtest1 | CREATE TABLE `sbtest1` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`k` int(10) unsigned NOT NULL DEFAULT '0',
`c` char(120) NOT NULL DEFAULT '',
`pad` char(60) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `k_1` (`k`)
) ENGINE=InnoDB AUTO_INCREMENT=
+------
1 row in set (0.00 sec)
mysql> select count(*) from sbtest1;
+----------+
| count(*) |
+----------+
| 30000 |
+----------+
1 row in set (0.51 sec)
mysql> alter table sbtest1 drop index k_1, add index k_1 (k);
Query OK, 30000 rows affected (1.38 sec)
Records: 30000 Duplicates: 0 Warnings: 0
However, following works fine:
mysql> alter table sbtest1 drop index k_1, add index k_2 (k);
Query OK, 0 rows affected (0.61 sec)
Records: 0 Duplicates: 0 Warnings: 0
Related branches
- Laurynas Biveinis (community): Approve
-
Diff: 101 lines (+32/-7)3 files modifieddoc/source/index.rst (+2/-2)
doc/source/management/innodb_buffer_pool_shm.rst (+23/-0)
doc/source/management/innodb_expanded_fast_index_creation.rst (+7/-5)
- Laurynas Biveinis (community): Approve
-
Diff: 115 lines (+4/-28)2 files modifieddoc/source/management/innodb_buffer_pool_shm.rst (+0/-26)
doc/source/management/innodb_expanded_fast_index_creation.rst (+4/-2)
Changed in percona-server: | |
assignee: | nobody → Hrvoje Matijakovic (hrvojem) |
This is probably related to the fix for http:// bugs.mysql. com/bug. php?id= 54927, http:// bugs.mysql. com/bug. php?id= 49838 etc. Let me quote http:// bugs.mysql. com/bug. php?id= 51451:
"[8 Apr 2010 15:09] Vasil Dimov
I think this is irrelevant after the fix of Bug#49838 because now MySQL does copy the table if the same index is dropped and added in the same ALTER."
So this is probably an (un)documented limitation.