• Marko Mäkelä's avatar
    MDEV-14648 Restore fix for MySQL BUG#39053 - UNINSTALL PLUGIN does not allow... · 6f314eda
    Marko Mäkelä authored
    MDEV-14648 Restore fix for MySQL BUG#39053 - UNINSTALL PLUGIN does not allow the storage engine to cleanup open connections
    
    Also, allow the MariaDB 10.2 server to link InnoDB dynamically
    against ha_innodb.so (which is what mysql-test-run.pl expects
    to exist, instead of the default name ha_innobase.so).
    
    wsrep_load_data_split(): Instead of referring to innodb_hton_ptr,
    check the handlerton::db_type. This was recently broken by me in
    MDEV-11415.
    
    innodb_lock_schedule_algorithm: Define as a weak global symbol,
    so that WITH_WSREP will not depend on InnoDB being linked statically.
    I tested this manually. Notably, running a test that only does
    	SET GLOBAL wsrep_on=1;
    with a static or dynamic InnoDB and
    	./mtr --mysqld=--loose-innodb-lock-schedule-algorithm=fcfs
    will crash with SIGSEGV at shutdown. With the default VATS
    combination the wsrep_on is properly refused for both the
    static and dynamic InnoDB.
    
    ha_close_connection(): Do invoke the method also for plugins
    for which UNINSTALL PLUGIN was deferred due to open connections.
    Thanks to @svoj for pointing this out.
    
    thd_to_trx(): Return a pointer, not a reference to a pointer.
    
    check_trx_exists(): Invoke thd_set_ha_data() for assigning a transaction.
    
    log_write_checkpoint_info(): Remove an unused DEBUG_SYNC point
    that would cause an assertion failure on shutdown after deferred
    UNINSTALL PLUGIN.
    
    This was tested as follows:
    
    cmake -DWITH_WSREP=1 -DPLUGIN_INNOBASE:STRING=DYNAMIC \
    -DWITH_MARIABACKUP:BOOL=OFF ...
    make
    cd mysql-test
    ./mtr innodb.innodb_uninstall
    6f314eda
ha_innodb.cc 642 KB