• Sergey Vojtovich's avatar
    BUG#39053 - UNISTALL PLUGIN does not allow the storage engine · b89feb5b
    Sergey Vojtovich authored
                to cleanup open connections
    
    It was possible to UNINSTALL storage engine plugin when binding
    between THD object and storage engine is still active (e.g. in
    the middle of transaction).
    
    To avoid unclean deactivation (uninstall) of storage engine plugin
    in the middle of transaction, additional storage engine plugin
    lock is acquired by thd_set_ha_data().
    
    If ha_data is not null and storage engine plugin was not locked
    by thd_set_ha_data() in this connection before, storage engine
    plugin gets locked.
    
    If ha_data is null and storage engine plugin was locked by
    thd_set_ha_data() in this connection before, storage engine
    plugin lock gets released.
    
    If handlerton::close_connection() didn't reset ha_data, server does
    it immediately after calling handlerton::close_connection().
    
    Note that this is just a framework fix, storage engines must switch
    to thd_set_ha_data() from thd_ha_data() if they want to see fit.
    b89feb5b
sql_class.cc 110 KB