From 92b3d4a3046ec39aa3737be6bd6b62a56fa641a6 Mon Sep 17 00:00:00 2001 From: marko <> Date: Wed, 5 Sep 2007 13:02:36 +0000 Subject: [PATCH] ha_innobase::external_lock(): Update prebuilt->mysql_has_locked and trx->n_mysql_tables_in_use only after row_lock_table_for_mysql() returns DB_SUCCESS. A timeout on LOCK TABLES would lead to an inconsistent state, which would cause trx_free() to print a warning. This was later reported as Bug #31444. --- handler/ha_innodb.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/handler/ha_innodb.cc b/handler/ha_innodb.cc index 0cbe0e72b0e..db7edf2af85 100644 --- a/handler/ha_innodb.cc +++ b/handler/ha_innodb.cc @@ -6456,9 +6456,6 @@ ha_innobase::external_lock( innobase_register_stmt(ht, thd); } - trx->n_mysql_tables_in_use++; - prebuilt->mysql_has_locked = TRUE; - if (trx->isolation_level == TRX_ISO_SERIALIZABLE && prebuilt->select_lock_type == LOCK_NONE && thd_test_options(thd, @@ -6507,6 +6504,9 @@ ha_innobase::external_lock( trx->mysql_n_tables_locked++; } + trx->n_mysql_tables_in_use++; + prebuilt->mysql_has_locked = TRUE; + DBUG_RETURN(0); }