From c3da5b0b7b7ff52aebd25c34bd2eebbc02cee417 Mon Sep 17 00:00:00 2001 From: "marko@hundin.mysql.fi" <> Date: Wed, 8 Jun 2005 15:45:56 +0300 Subject: InnoDB: Do not distinguish explicitly requested table locks. Since UNLOCK TABLES will commit the transaction (and thus release all InnoDB locks held by it), it is unnecessary to release the user-requested table locks separately. --- sql/ha_innodb.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'sql/ha_innodb.cc') diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 91c1dab44f1..2675ccdbfbb 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -5719,7 +5719,7 @@ ha_innobase::external_lock( ulint error; error = row_lock_table_for_mysql(prebuilt, - NULL, LOCK_TABLE_EXP); + NULL, 0); if (error != DB_SUCCESS) { error = convert_error_code_to_mysql( @@ -5739,9 +5739,6 @@ ha_innobase::external_lock( trx->n_mysql_tables_in_use--; prebuilt->mysql_has_locked = FALSE; auto_inc_counter_for_this_stat = 0; - if (trx->n_lock_table_exp) { - row_unlock_tables_for_mysql(trx); - } /* If the MySQL lock count drops to zero we know that the current SQL statement has ended */ @@ -5783,7 +5780,7 @@ user issued query LOCK TABLES..WHERE ENGINE = InnoDB. */ int ha_innobase::transactional_table_lock( /*==================================*/ - /* out: 0 */ + /* out: error code */ THD* thd, /* in: handle to the user thread */ int lock_type) /* in: lock type */ { @@ -5847,8 +5844,7 @@ ha_innobase::transactional_table_lock( if (thd->in_lock_tables && thd->variables.innodb_table_locks) { ulint error = DB_SUCCESS; - error = row_lock_table_for_mysql(prebuilt,NULL, - LOCK_TABLE_TRANSACTIONAL); + error = row_lock_table_for_mysql(prebuilt, NULL, 0); if (error != DB_SUCCESS) { error = convert_error_code_to_mysql(error, user_thd); -- cgit v1.2.1