summaryrefslogtreecommitdiff
path: root/sql/lock.cc
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2001-09-08 11:47:34 +0300
committerunknown <monty@hundin.mysql.fi>2001-09-08 11:47:34 +0300
commit8e9c21de2ba0a41ba81ce14f0c5bbaa2187015b3 (patch)
tree519c781289c4f4c0769d932057d293ba813f2b8c /sql/lock.cc
parent0ce7e16ef3b9fbe6aa253ac9cef407710dd250e9 (diff)
downloadmariadb-git-8e9c21de2ba0a41ba81ce14f0c5bbaa2187015b3.tar.gz
More debug info
Fix DBUG_ASSERT() Optimization for BDB tables Fix for BDB under Win98 Docs/manual.texi: Removed wrong info bdb/os_win32/os_rename.c: Fix for windows 98 configure.in: Better options for MAC OS X include/dbug.h: Fix DBUG_ASSERT() mysys/thr_lock.c: More DBUG messages sql/ha_berkeley.cc: Use cursor in remove_key sql/lock.cc: Fix possible problem when pre-unlocking tables in SELECT sql/sql_select.cc: More DBUG messages sql/violite.c: Fix DBUG messages
Diffstat (limited to 'sql/lock.cc')
-rw-r--r--sql/lock.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/sql/lock.cc b/sql/lock.cc
index a8b26c3b17d..7bac2d54631 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -169,8 +169,11 @@ static int lock_external(TABLE **tables,uint count)
void mysql_unlock_tables(THD *thd, MYSQL_LOCK *sql_lock)
{
DBUG_ENTER("mysql_unlock_tables");
- thr_multi_unlock(sql_lock->locks,sql_lock->lock_count);
- VOID(unlock_external(thd,sql_lock->table,sql_lock->table_count));
+ if (sql_lock->lock_count)
+ {
+ thr_multi_unlock(sql_lock->locks,sql_lock->lock_count);
+ VOID(unlock_external(thd,sql_lock->table,sql_lock->table_count));
+ }
my_free((gptr) sql_lock,MYF(0));
DBUG_VOID_RETURN;
}
@@ -213,7 +216,7 @@ void mysql_unlock_read_tables(THD *thd, MYSQL_LOCK *sql_lock)
if (i != found)
{
thr_multi_unlock(lock,i-found);
- sql_lock->lock_count-=found;
+ sql_lock->lock_count= found;
}
/* Then to the same for the external locks */
@@ -232,7 +235,7 @@ void mysql_unlock_read_tables(THD *thd, MYSQL_LOCK *sql_lock)
if (i != found)
{
VOID(unlock_external(thd,table,i-found));
- sql_lock->table_count-=found;
+ sql_lock->table_count=found;
}
DBUG_VOID_RETURN;
}