197
|
|
|
Oleg Tsarev |
12 years ago
|
|
|
196
|
|
|
Oleg Tsarev |
12 years ago
|
|
|
195
|
|
Bug #848703: innodb_fast_alter_column doesn't work with indexed columns
The problem was that when extending a column involved in an index, mysql_alter_table() marked the corresponding index to be recreated later (by adding it to both index_drop_buffer and index_add_buffer). Such ALTER TABLE would normally be executed by copying the table, because InnoDB would report incompatible metadata in such a case.
However, due to innodb_fast_alter_column turned on, the metadata was rightfully considered compatible, so the ALTER TABLE was executed in-place, by first adding the indexes from index_add_buffer and then dropping the ones from index_drop_buffer. Since in this case both drop and add list contained the same index, InnoDB reported a duplicate index name when trying to add the index. Reverting the order (i.e. dropping before adding) would cause problems with foreign key constraints.
Fixed by changing compare_tables() so that, if innodb_fast_alter_column is on, extending an index column does not lead to index being marked as changed.
In addition, InnoDB no longer reports extending columns as compatible metadata when innodb_fast_alter_column is OFF. This was the reasons why the bug occurred even with disabled feature.
|
Alexey Kopytov |
12 years ago
|
|
|
194
|
|
|
Oleg Tsarev |
12 years ago
|
|
|
193
|
|
|
Oleg Tsarev |
12 years ago
|
|
|
192
|
|
|
Oleg Tsarev |
12 years ago
|
|
|
191
|
|
|
Alexey Kopytov |
12 years ago
|
|
|
190
|
|
|
Alexey Kopytov |
12 years ago
|
|
|
189
|
|
|
Alexey Kopytov |
12 years ago
|
|
|
188
|
|
|
Oleg Tsarev |
12 years ago
|
|
|
187
|
|
|
Alexey Kopytov |
12 years ago
|
|
|
186
|
|
|
Alexey Kopytov |
12 years ago
|
|
|
185
|
|
|
Oleg Tsarev |
12 years ago
|
|
|
184
|
|
|
Oleg Tsarev |
12 years ago
|
|
|
183
|
|
|
Oleg Tsarev |
12 years ago
|
|
|
182
|
|
|
Oleg Tsarev |
12 years ago
|
|
|
181
|
|
|
Oleg Tsarev |
12 years ago
|
|
|
180
|
|
|
Oleg Tsarev |
12 years ago
|
|
|
179
|
|
|
Laurynas Biveinis |
12 years ago
|
|
|
178
|
|
|
Laurynas Biveinis |
12 years ago
|
|
|