1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge mysql.com:/opt/local/work/mysql-5.0-merge

into  mysql.com:/opt/local/work/mysql-5.1-merge


include/config-win.h:
  Auto merged
mysys/hash.c:
  Auto merged
mysql-test/r/rpl_stm_sp.result:
  Auto merged
mysql-test/t/rpl_stm_sp.test:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_cache.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp:
  Auto merged
mysql-test/r/information_schema.result:
  Manual merge.
mysql-test/t/information_schema.test:
  Manual merge.
sql/lock.cc:
  Manual merge.
This commit is contained in:
unknown
2006-01-05 00:38:51 +03:00
10 changed files with 118 additions and 50 deletions

View File

@ -1702,6 +1702,7 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
char key[MAX_DBKEY_LENGTH];
uint key_length;
char *alias= table_list->alias;
HASH_SEARCH_STATE state;
DBUG_ENTER("open_table");
/* find a unused table in the open table cache */
@ -1862,9 +1863,11 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
if (thd->handler_tables)
mysql_ha_flush(thd, (TABLE_LIST*) NULL, MYSQL_HA_REOPEN_ON_USAGE, TRUE);
for (table=(TABLE*) hash_search(&open_cache,(byte*) key,key_length) ;
for (table= (TABLE*) hash_first(&open_cache, (byte*) key, key_length,
&state);
table && table->in_use ;
table = (TABLE*) hash_next(&open_cache,(byte*) key,key_length))
table= (TABLE*) hash_next(&open_cache, (byte*) key, key_length,
&state))
{
if (table->s->version != refresh_version)
{
@ -2240,10 +2243,12 @@ bool table_is_used(TABLE *table, bool wait_for_name_lock)
uint key_length= table->s->table_cache_key.length;
DBUG_PRINT("loop", ("table_name: %s", table->alias));
for (TABLE *search=(TABLE*) hash_search(&open_cache,
(byte*) key,key_length) ;
HASH_SEARCH_STATE state;
for (TABLE *search= (TABLE*) hash_first(&open_cache, (byte*) key,
key_length, &state);
search ;
search = (TABLE*) hash_next(&open_cache,(byte*) key,key_length))
search= (TABLE*) hash_next(&open_cache, (byte*) key,
key_length, &state))
{
DBUG_PRINT("info", ("share: 0x%lx locked_by_flush: %d "
"locked_by_name: %d db_stat: %u version: %u",
@ -5848,11 +5853,14 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name,
key_length=(uint) (strmov(strmov(key,db)+1,table_name)-key)+1;
for (;;)
{
HASH_SEARCH_STATE state;
result= signalled= 0;
for (table=(TABLE*) hash_search(&open_cache,(byte*) key,key_length) ;
for (table= (TABLE*) hash_first(&open_cache, (byte*) key, key_length,
&state);
table;
table = (TABLE*) hash_next(&open_cache,(byte*) key,key_length))
table= (TABLE*) hash_next(&open_cache, (byte*) key, key_length,
&state))
{
THD *in_use;
table->s->version=0L; /* Free when thread is ready */