mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Bug #10600 After review fixes
This commit is contained in:
@ -187,7 +187,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
|
||||
}
|
||||
|
||||
abort_locked_tables(thd,db,table->real_name);
|
||||
flags= WAIT_OTHER_THREAD_FLAG | CHECK_KILLED_FLAG;
|
||||
flags= RTFC_WAIT_OTHER_THREAD_FLAG | RTFC_CHECK_KILLED_FLAG;
|
||||
remove_table_from_cache(thd,db,table->real_name,flags);
|
||||
drop_locked_tables(thd,db,table->real_name);
|
||||
if (thd->killed)
|
||||
@ -976,7 +976,6 @@ mysql_rename_table(enum db_type base,
|
||||
static void wait_while_table_is_used(THD *thd,TABLE *table,
|
||||
enum ha_extra_function function)
|
||||
{
|
||||
uint flags;
|
||||
DBUG_PRINT("enter",("table: %s", table->real_name));
|
||||
DBUG_ENTER("wait_while_table_is_used");
|
||||
safe_mutex_assert_owner(&LOCK_open);
|
||||
@ -986,9 +985,8 @@ static void wait_while_table_is_used(THD *thd,TABLE *table,
|
||||
mysql_lock_abort(thd, table); // end threads waiting on lock
|
||||
|
||||
/* Wait until all there are no other threads that has this table open */
|
||||
flags= WAIT_OTHER_THREAD_FLAG;
|
||||
remove_table_from_cache(thd,table->table_cache_key,
|
||||
table->real_name,flags);
|
||||
table->real_name, RTFC_WAIT_OTHER_THREAD_FLAG);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
@ -1305,7 +1303,7 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables,
|
||||
const char *old_message=thd->enter_cond(&COND_refresh, &LOCK_open,
|
||||
"Waiting to get writelock");
|
||||
mysql_lock_abort(thd,table->table);
|
||||
flags= WAIT_OTHER_THREAD_FLAG | CHECK_KILLED_FLAG;
|
||||
flags= RTFC_WAIT_OTHER_THREAD_FLAG | RTFC_CHECK_KILLED_FLAG;
|
||||
remove_table_from_cache(thd, table->table->table_cache_key,
|
||||
table->table->real_name, flags);
|
||||
thd->exit_cond(old_message);
|
||||
@ -1372,10 +1370,9 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables,
|
||||
table->table->version=0; // Force close of table
|
||||
else if (open_for_modify)
|
||||
{
|
||||
uint flags= 0;
|
||||
pthread_mutex_lock(&LOCK_open);
|
||||
remove_table_from_cache(thd, table->table->table_cache_key,
|
||||
table->table->real_name, flags);
|
||||
table->table->real_name, RTFC_NO_FLAG);
|
||||
pthread_mutex_unlock(&LOCK_open);
|
||||
/* May be something modified consequently we have to invalidate cache */
|
||||
query_cache_invalidate3(thd, table->table, 0);
|
||||
@ -2099,9 +2096,9 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
|
||||
*/
|
||||
if (table)
|
||||
{
|
||||
uint flags= 0;
|
||||
VOID(table->file->extra(HA_EXTRA_FORCE_REOPEN)); // Use new file
|
||||
remove_table_from_cache(thd,db,table_name,flags);// Mark in-use copies old
|
||||
remove_table_from_cache(thd,db,table_name,RTFC_NO_FLAG);
|
||||
// Mark in-use copies old
|
||||
mysql_lock_abort(thd,table); // end threads waiting on lock
|
||||
}
|
||||
VOID(quick_rm_table(old_db_type,db,old_name));
|
||||
|
Reference in New Issue
Block a user