diff options
author | ramil/ram@myoffice.izhnet.ru <> | 2006-11-28 13:49:43 +0400 |
---|---|---|
committer | ramil/ram@myoffice.izhnet.ru <> | 2006-11-28 13:49:43 +0400 |
commit | 25b50245717428480359b90ab68a458c3f02ffb1 (patch) | |
tree | e0af90ba62686a06e493571befdda8dd352edbb4 /sql/sql_handler.cc | |
parent | 1c8a6cfc37d4ebda5732c73efa0bc8461bd4f62d (diff) | |
parent | 55aa6e04bd7a7b8b5b86fa15efe9d253a9650eeb (diff) | |
download | mariadb-git-25b50245717428480359b90ab68a458c3f02ffb1.tar.gz |
Merge mysql.com:/usr/home/ram/work/bug21587/my50-bug21587
into mysql.com:/usr/home/ram/work/bug21587/my51-bug21587
Diffstat (limited to 'sql/sql_handler.cc')
-rw-r--r-- | sql/sql_handler.cc | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index 0d893a6c9be..a6ab100cad4 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -756,3 +756,41 @@ static int mysql_ha_flush_table(THD *thd, TABLE **table_ptr, uint mode_flags) DBUG_RETURN(0); } + + +/* + Mark tables for reopen. + + SYNOPSIS + mysql_ha_mark_tables_for_reopen() + thd Thread identifier. + table Table list to mark for reopen. + + DESCRIPTION + For each table found in the handler hash mark it as closed + (ready for reopen) and end all index/table scans. + + NOTE + The caller must lock LOCK_open. +*/ + +void mysql_ha_mark_tables_for_reopen(THD *thd, TABLE *table) +{ + DBUG_ENTER("mysql_ha_mark_tables_for_reopen"); + + safe_mutex_assert_owner(&LOCK_open); + for (; table; table= table->next) + { + TABLE_LIST *hash_tables; + if ((hash_tables= (TABLE_LIST*) hash_search(&thd->handler_tables_hash, + (byte*) table->alias, + strlen(table->alias) + 1))) + { + /* Mark table as ready for reopen. */ + hash_tables->table= NULL; + /* End open index/table scans. */ + table->file->ha_index_or_rnd_end(); + } + } + DBUG_VOID_RETURN; +} |