• Nisha Gopalakrishnan's avatar
    BUG#27216817: INNODB: FAILING ASSERTION: · c0b4d74b
    Nisha Gopalakrishnan authored
                  PREBUILT->TABLE->N_MYSQL_HANDLES_OPENED == 1
    
    ANALYSIS:
    =========
    
    Adding unique index to a InnoDB table which is locked as
    mutliple instances may trigger an InnoDB assert.
    
    When we add a primary key or an unique index, we need to
    drop the original table and rebuild all indexes. InnoDB
    expects that only the instance of the table that is being
    rebuilt, is open during the process. In the current
    scenario we have opened multiple instances of the table.
    This triggers an assert during table rebuild.
    'Locked_tables_list' encapsulates a list of all
    instances of tables locked by LOCK TABLES statement.
    
    FIX:
    ===
    We are now temporarily closing all the instances of the
    table except the one which is being altered and later
    reopen them via Locked_tables_list::reopen_tables().
    c0b4d74b
sql_trigger.cc 76 KB