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); }