diff options
author | unknown <mronstrom@mysql.com> | 2005-07-19 00:29:19 +0200 |
---|---|---|
committer | unknown <mronstrom@mysql.com> | 2005-07-19 00:29:19 +0200 |
commit | 6d29b23b15cdb14e0f60804db4eaeb5718cec78a (patch) | |
tree | 8cac93afd968960ab2b0e70bf1d21eaefadecd79 /sql/lock.cc | |
parent | 5c27ff06c739c405c3ef09357c4f7deeae40b4b1 (diff) | |
download | mariadb-git-6d29b23b15cdb14e0f60804db4eaeb5718cec78a.tar.gz |
Bug #10600
remove_table_from_cache fails to signal other thread and gets
blocked when other thread also gets blocked
include/thr_lock.h:
Report if any threads was signalled
mysys/thr_lock.c:
Report if any threads was signalled
sql/lock.cc:
Report if any threads was signalled
Use new interface for remove_table_from_cache
sql/mysql_priv.h:
New interface for remove_table_from_cache
+ mysql_lock_abort_for_thread
sql/sql_base.cc:
Use new interface of remove_table_cache
Rewrote remove_table_from_cache to fix bug
sql/sql_table.cc:
Use new interface of remove_table_from_cache
Diffstat (limited to 'sql/lock.cc')
-rw-r--r-- | sql/lock.cc | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/sql/lock.cc b/sql/lock.cc index 4c6d7c75ae2..dbd7748e104 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -333,20 +333,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); } @@ -542,8 +547,15 @@ 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 + + { + uint flags= 0; + if (remove_table_from_cache(thd, db, + table_list->real_name, flags)) + { + DBUG_RETURN(1); // Table is in use + } + } DBUG_RETURN(0); } |