Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.4.0
-
None
Description
A rollback of instant ALTER TABLE may leave the InnoDB data dictionary cache in an inconsistent state:
--source include/have_innodb.inc
|
create table t1 (a int, b int) engine=innodb; |
set @save_dbug = @@session.debug_dbug; |
set debug_dbug='+d,ib_commit_inplace_fail_1'; |
--error ER_INTERNAL_ERROR
|
alter table t1 drop column b, algorithm=instant; |
set debug_dbug= @save_dbug; |
--echo # The following would crash!
|
insert into t1 values (1,1); |
select * from t1; |
drop table t1; |
The problem is that dict_index_t::n_core_fields is not being restored by dict_table_t::rollback_instant().
We have to be careful when restoring it, because the original value (as it was at the start of the instant ALTER TABLE that is being rolled back) may be stale, in case the table was found to be empty during the operation.
Attachments
Issue Links
- blocks
-
MDEV-17697 Broken versioning info after instant drop column
- Closed
- is caused by
-
MDEV-15562 Instant DROP COLUMN or changing the order of columns
- Closed