summaryrefslogtreecommitdiff
path: root/sql/lock.cc
diff options
context:
space:
mode:
authorunknown <pappa@c-450ae253.1238-1-64736c10.cust.bredbandsbolaget.se>2005-07-20 21:58:33 -0400
committerunknown <pappa@c-450ae253.1238-1-64736c10.cust.bredbandsbolaget.se>2005-07-20 21:58:33 -0400
commita3fe765249cd6b23dcd59a9bda3f310606877dc8 (patch)
tree67806b9ee022b7209440238f0cf7228d9e910a58 /sql/lock.cc
parentbf4dfde9fc729894eb745b58ced160133ecde510 (diff)
parentaf1dfb613b7ce6343f461d6f4c3def6af9354814 (diff)
downloadmariadb-git-a3fe765249cd6b23dcd59a9bda3f310606877dc8.tar.gz
Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-4.0
into c-450ae253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/mysql-4.1 include/thr_lock.h: Auto merged mysys/thr_lock.c: Auto merged sql/lock.cc: Auto merged sql/mysql_priv.h: Auto merged sql/sql_base.cc: Auto merged sql/sql_table.cc: Manual merge after 4.0 fix
Diffstat (limited to 'sql/lock.cc')
-rw-r--r--sql/lock.cc23
1 files changed, 17 insertions, 6 deletions
diff --git a/sql/lock.cc b/sql/lock.cc
index 4e34f766c61..f8697cd9bc6 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -337,20 +337,25 @@ void mysql_lock_abort(THD *thd, TABLE *table)
/* Abort one thread / table combination */
-void mysql_lock_abort_for_thread(THD *thd, TABLE *table)
+bool mysql_lock_abort_for_thread(THD *thd, TABLE *table)
{
MYSQL_LOCK *locked;
TABLE *write_lock_used;
+ bool result= FALSE;
DBUG_ENTER("mysql_lock_abort_for_thread");
if ((locked = get_lock_data(thd,&table,1,1,&write_lock_used)))
{
for (uint i=0; i < locked->lock_count; i++)
- thr_abort_locks_for_thread(locked->locks[i]->lock,
- table->in_use->real_id);
+ {
+ bool found;
+ found= thr_abort_locks_for_thread(locked->locks[i]->lock,
+ table->in_use->real_id);
+ result|= found;
+ }
my_free((gptr) locked,MYF(0));
}
- DBUG_VOID_RETURN;
+ DBUG_RETURN(result);
}
@@ -578,8 +583,14 @@ int lock_table_name(THD *thd, TABLE_LIST *table_list)
my_free((gptr) table,MYF(0));
DBUG_RETURN(-1);
}
- if (remove_table_from_cache(thd, db, table_list->real_name))
- DBUG_RETURN(1); // Table is in use
+
+ {
+ if (remove_table_from_cache(thd, db,
+ table_list->real_name, RTFC_NO_FLAG))
+ {
+ DBUG_RETURN(1); // Table is in use
+ }
+ }
DBUG_RETURN(0);
}