• Marko Mäkelä's avatar
    Bug#12861864 RACE CONDITION IN BTR_GET_SIZE() AND DROP INDEX/TABLE/DATABASE · 0664bb7c
    Marko Mäkelä authored
    also filed as Bug#13146269, Bug#13713178
    
    btr_get_size(): Add mtr_t parameter. Require that the caller S-latches
    index->lock. If index->page==FIL_NULL or the index is to be dropped,
    return ULINT_UNDEFINED to indicate that the statistics are
    unavailable.
    
    dict_update_statistics(): If btr_get_size() returns ULINT_UNDEFINED,
    fake the index cardinality statistics.
    
    dict_index_set_page(): Unused function, remove.
    
    row_drop_table_for_mysql(): Before starting to drop the table, mark
    the indexes unavailable in the data dictionary cache while holding
    index->lock X-latch.
    
    ha_innobase::prepare_drop_index(), ha_innobase::final_drop_index():
    When setting index->to_be_dropped, acquire the index->lock X-latch.
    
    rb:960 approved by Jimmy Yang
    0664bb7c
dict0dict.ic 22.1 KB