• marko's avatar
    branches/zip: ha_innobase::add_index(): Fix a race condition that · 5cff2592
    marko authored
    existed before the fast-index-creation code was merged, in r1414.
    
    Do not call row_prebuilt_table_obsolete(innodb_table) until after
    the table has been renamed to a temporary name.  Otherwise, the
    following could happen when creating a clustered index on table T:
    
    (a1) copy T to T#1
    (a2) mark T obsolete
    (b1) add the name of T to the background drop list
    (a3) rename T to T#2 and T#1 to T
    (b2) drop the table on the background
    
    These steps are executed by two threads, a and b.
    
    If b1 is executed after a3, all is fine: the name T#2 will be added
    to the background drop list.  If b1 is executed before a3, the name
    T will be added, and T#2 will survive.
    5cff2592
ha_innodb.cc 261 KB