diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index 4e58c30b812a6732899e0bfeb50cbea852150a35..af7b9c25f184f6d13543ccfcbad5f78f44c67fef 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -16,7 +16,6 @@ ctype_big5               : BUG#26711 2007-06-21 Lars Test has never worked on Do
 
 federated_transactions   : Bug#29523 Transactions do not work
 lowercase_table3         : Bug#32667 lowercase_table3.test reports to error log
-innodb_mysql         : Bug#32724: innodb_mysql.test fails randomly
 ctype_create         : Bug#32965 main.ctype_create fails
 status               : Bug#32966 main.status fails
 ps_ddl               : Bug#12093 2007-12-14 pending WL#4165 / WL#4166
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 3edad3a2184132725f72129cad8e105c9f44e7ee..c28fea57c64c1c88ea12b0c60ccbd94720042047 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -3301,6 +3301,7 @@ end_with_restore_list:
         can free its locks if LOCK TABLES locked some tables before finding
         that it can't lock a table in its list
       */
+      ha_autocommit_or_rollback(thd, 1);
       end_active_trans(thd);
       thd->options&= ~(OPTION_TABLE_LOCK);
     }