diff options
author | unknown <monty@hundin.mysql.fi> | 2001-09-08 20:45:53 +0300 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2001-09-08 20:45:53 +0300 |
commit | 851bea0e88c0148b87eda3b32d287ef3211b262f (patch) | |
tree | ace5d8956a44c55c16f2016294db718ae8fb43a1 /sql/lock.cc | |
parent | 8e9c21de2ba0a41ba81ce14f0c5bbaa2187015b3 (diff) | |
download | mariadb-git-851bea0e88c0148b87eda3b32d287ef3211b262f.tar.gz |
Fix bugs when using LOCK TABLES with BDB tables
Optimized remove of key when using internal cursor in BDB tables.
mysql-test/r/bdb.result:
Test for LOCK bug
mysql-test/t/bdb.test:
Test for LOCK bug
sql/ha_berkeley.cc:
Fix bugs when using LOCK TABLES
Optimized remove of key when using internal cursor
sql/ha_berkeley.h:
Initilize of changed_rows
sql/lock.cc:
Fix for BDB tables
Diffstat (limited to 'sql/lock.cc')
-rw-r--r-- | sql/lock.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/lock.cc b/sql/lock.cc index 7bac2d54631..aa06822e03f 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -170,10 +170,9 @@ void mysql_unlock_tables(THD *thd, MYSQL_LOCK *sql_lock) { DBUG_ENTER("mysql_unlock_tables"); if (sql_lock->lock_count) - { thr_multi_unlock(sql_lock->locks,sql_lock->lock_count); + if (sql_lock->table_count) VOID(unlock_external(thd,sql_lock->table,sql_lock->table_count)); - } my_free((gptr) sql_lock,MYF(0)); DBUG_VOID_RETURN; } @@ -317,7 +316,7 @@ static int unlock_external(THD *thd, TABLE **table,uint count) DBUG_ENTER("unlock_external"); error_code=0; - for (; count-- ; table++) + do { if ((*table)->current_lock != F_UNLCK) { @@ -325,7 +324,8 @@ static int unlock_external(THD *thd, TABLE **table,uint count) if ((error=(*table)->file->external_lock(thd, F_UNLCK))) error_code=error; } - } + table++; + } while (--count); if (error_code) print_lock_error(error_code); DBUG_RETURN(error_code); |