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

FLUSH TABLE table_list

Fixes for RENAME TABLE
Portability fixes
This commit is contained in:
monty@donna.mysql.com
2000-08-22 00:18:32 +03:00
parent 48ee575ebc
commit f0952ce3e1
58 changed files with 502 additions and 400 deletions

View File

@ -418,7 +418,11 @@ int lock_table_name(THD *thd, TABLE_LIST *table_list)
return 0;
/* Create a table entry with the right key and with an old refresh version */
if (!(table= (TABLE*) thd->calloc(sizeof(*table)+key_length)))
/* Note that we must use my_malloc() here as this is freed by the table
cache */
if (!(table= (TABLE*) my_malloc(sizeof(*table)+key_length,
MYF(MY_WME | MY_ZEROFILL))))
return -1;
memcpy((table->table_cache_key= (char*) (table+1)), key, key_length);
table->key_length=key_length;
@ -435,7 +439,7 @@ int lock_table_name(THD *thd, TABLE_LIST *table_list)
void unlock_table_name(THD *thd, TABLE_LIST *table_list)
{
if (table_list->table)
hash_delete(&open_cache, (gptr) table_list->table);
hash_delete(&open_cache, (byte*) table_list->table);
}
static bool locked_named_table(THD *thd, TABLE_LIST *table_list)
@ -461,10 +465,7 @@ bool wait_for_locked_table_names(THD *thd, TABLE_LIST *table_list)
break;
}
wait_for_refresh(thd);
pthread_mutex_lock(&LOCK_open);
}
pthread_mutex_lock(&thd->mysys_var->mutex);
thd->mysys_var->current_mutex=0;
thd->mysys_var->current_cond=0;
pthread_mutex_unlock(&thd->mysys_var->mutex);
return result;
}