mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
MDEV-6497 InnoDB deadlocks on UNINSTALL PLUGIN
Free the trx of the current thd (if any) in innobase_end()
This commit is contained in:
parent
0aa40c35ca
commit
6ef139780d
4 changed files with 36 additions and 0 deletions
|
@ -4,4 +4,17 @@ Warning 1105 Cannot enable tc-log at run-time. XA features of InnoDB are disable
|
|||
select engine,support,transactions,xa from information_schema.engines where engine='innodb';
|
||||
engine support transactions xa
|
||||
InnoDB YES YES NO
|
||||
create table t1 (a int) engine=innodb;
|
||||
start transaction;
|
||||
insert t1 values (1);
|
||||
insert t1 values (2);
|
||||
commit;
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
mysqld-bin.000001 # Query # # use `test`; create table t1 (a int) engine=innodb
|
||||
mysqld-bin.000001 # Query # # BEGIN
|
||||
mysqld-bin.000001 # Query # # use `test`; insert t1 values (1)
|
||||
mysqld-bin.000001 # Query # # use `test`; insert t1 values (2)
|
||||
mysqld-bin.000001 # Query # # COMMIT
|
||||
drop table t1;
|
||||
uninstall plugin innodb;
|
||||
|
|
|
@ -8,4 +8,11 @@ if (!$HA_INNODB_SO) {
|
|||
}
|
||||
install plugin innodb soname 'ha_innodb';
|
||||
select engine,support,transactions,xa from information_schema.engines where engine='innodb';
|
||||
create table t1 (a int) engine=innodb;
|
||||
start transaction;
|
||||
insert t1 values (1);
|
||||
insert t1 values (2);
|
||||
commit;
|
||||
--source include/show_binlog_events.inc
|
||||
drop table t1;
|
||||
uninstall plugin innodb;
|
||||
|
|
|
@ -2658,6 +2658,14 @@ innobase_end(
|
|||
|
||||
if (innodb_inited) {
|
||||
|
||||
THD *thd= current_thd;
|
||||
if (thd) { // may be UNINSTALL PLUGIN statement
|
||||
trx_t* trx = thd_to_trx(thd);
|
||||
if (trx) {
|
||||
trx_free_for_mysql(trx);
|
||||
}
|
||||
}
|
||||
|
||||
srv_fast_shutdown = (ulint) innobase_fast_shutdown;
|
||||
innodb_inited = 0;
|
||||
hash_table_free(innobase_open_tables);
|
||||
|
|
|
@ -3276,6 +3276,14 @@ innobase_end(
|
|||
|
||||
if (innodb_inited) {
|
||||
|
||||
THD *thd= current_thd;
|
||||
if (thd) { // may be UNINSTALL PLUGIN statement
|
||||
trx_t* trx = thd_to_trx(thd);
|
||||
if (trx) {
|
||||
trx_free_for_mysql(trx);
|
||||
}
|
||||
}
|
||||
|
||||
srv_fast_shutdown = (ulint) innobase_fast_shutdown;
|
||||
innodb_inited = 0;
|
||||
hash_table_free(innobase_open_tables);
|
||||
|
|
Loading…
Add table
Reference in a new issue