diff options
author | unknown <svoj@april.(none)> | 2007-07-25 19:58:18 +0500 |
---|---|---|
committer | unknown <svoj@april.(none)> | 2007-07-25 19:58:18 +0500 |
commit | 34864af8fd6b12d507d34c0f1b29167cc23928b2 (patch) | |
tree | 3894b838cefa470476224e6abb155cc557665ce5 /sql/lock.cc | |
parent | 8a159e381b0dbbc1d3d5645d46e05be771578e4f (diff) | |
parent | 4537a0c9e97e19b34bd4cc1969ce388f4ac48ccc (diff) | |
download | mariadb-git-34864af8fd6b12d507d34c0f1b29167cc23928b2.tar.gz |
Merge mysql.com:/home/svoj/devel/bk/mysql-5.1-engines
into mysql.com:/home/svoj/devel/mysql/BUG29806/mysql-5.1-engines
sql/ha_ndbcluster.cc:
Auto merged
sql/lock.cc:
Auto merged
Diffstat (limited to 'sql/lock.cc')
-rw-r--r-- | sql/lock.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/lock.cc b/sql/lock.cc index 4260a031def..63d0807b975 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -60,6 +60,11 @@ - When calling UNLOCK TABLES we call mysql_unlock_tables() for all tables used in LOCK TABLES + If table_handler->external_lock(thd, locktype) fails, we call + table_handler->external_lock(thd, F_UNLCK) for each table that was locked, + excluding one that caused failure. That means handler must cleanup itself + in case external_lock() fails. + TODO: Change to use my_malloc() ONLY when using LOCK TABLES command or when we are forced to use mysql_lock_merge. @@ -269,8 +274,9 @@ static int lock_external(THD *thd, TABLE **tables, uint count) if ((error=(*tables)->file->ha_external_lock(thd,lock_type))) { print_lock_error(error, (*tables)->file->table_type()); - for (; i-- ; tables--) + while (--i) { + tables--; (*tables)->file->ha_external_lock(thd, F_UNLCK); (*tables)->current_lock=F_UNLCK; } |