Commit 9af502ed authored by unknown's avatar unknown

protected close_cached_table() call in REPAIR ... USE_FRM with a mutex

test for REPAIR ... USE_FRM added


sql/sql_table.cc:
  protected close_cached_table() call in REPAIR ... USE_FRM with a mutex
parent b12cc1ab
drop table if exists t1;
create table t1 SELECT 1,"table 1";
repair table t1 use_frm;
Table Op Msg_type Msg_text
test.t1 repair warning Number of rows changed from 0 to 1
test.t1 repair status OK
drop table if exists t1;
#
# Test of repair table
#
drop table if exists t1;
create table t1 SELECT 1,"table 1";
repair table t1 use_frm;
drop table if exists t1;
......@@ -972,7 +972,9 @@ static int prepare_for_repair(THD* thd, TABLE_LIST* table,
fn_format(from, from, "", MI_NAME_DEXT, 4);
sprintf(tmp,"%s-%lx_%lx", from, current_pid, thd->thread_id);
pthread_mutex_lock(&LOCK_open);
close_cached_table(thd,table->table);
pthread_mutex_unlock(&LOCK_open);
if (lock_and_wait_for_table_name(thd,table))
DBUG_RETURN(-1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment