Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-18098

Crash after rollback of instant DROP COLUMN

    XMLWordPrintable

    Details

      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

            Activity

              People

              Assignee:
              marko Marko Mäkelä
              Reporter:
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: