• unknown's avatar
    Bug #16305265 HANG IN RENAME TABLE · e1e43631
    unknown authored
    This is a deadlock that will also be fixed in the server by
    Bug #11844915 - HANG IN THDVAR MUTEX ACQUISITION.
    So this is a simple alternate method of fixing the same problem,
    but from within InnoDB.
    
    The simple change is to make rename table start a transaction
    before locking dict_sys->mutex since thd_supports_xa() can call
    THDVAR which can lock a mutex, LOCK_global_system_variables, that
    is used in the server by many other activities.  At least one of
    those, sys_var::update(), can call back into InnoDB and try to
    lock dict_sys->mutex while holding LOCK_global_system_variables.
    
    The other bug fix for 11844915 eliminates the use of
    LOCK_global_system_variables for calls to THDVAR.
    
    Approved by marko in http://rb.no.oracle.com/rb/r/2000/
    e1e43631
row0mysql.c 117 KB