diff options
author | unknown <ramil/ram@myoffice.izhnet.ru> | 2006-11-28 13:49:43 +0400 |
---|---|---|
committer | unknown <ramil/ram@myoffice.izhnet.ru> | 2006-11-28 13:49:43 +0400 |
commit | ed0c42f3af169dc08a008ecbe2047c3afdfeb86f (patch) | |
tree | e0af90ba62686a06e493571befdda8dd352edbb4 /sql/sql_handler.cc | |
parent | b48ff93e29988f2f33103ff6b87c830a2e1f9190 (diff) | |
parent | 838b5378cb1998b27b106273f5e9043838888d39 (diff) | |
download | mariadb-git-ed0c42f3af169dc08a008ecbe2047c3afdfeb86f.tar.gz |
Merge mysql.com:/usr/home/ram/work/bug21587/my50-bug21587
into mysql.com:/usr/home/ram/work/bug21587/my51-bug21587
sql/mysql_priv.h:
Auto merged
sql/sql_handler.cc:
Auto merged
sql/sql_base.cc:
merging
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; +} |