From 8e9c21de2ba0a41ba81ce14f0c5bbaa2187015b3 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 8 Sep 2001 11:47:34 +0300 Subject: 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 --- sql/lock.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'sql/lock.cc') 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; } -- cgit v1.2.1