Commit 98075012 authored by serg@serg.mysql.com's avatar serg@serg.mysql.com

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

test for REPAIR ... USE_FRM added
parent 7c4e5bd9
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, ...@@ -972,7 +972,9 @@ static int prepare_for_repair(THD* thd, TABLE_LIST* table,
fn_format(from, from, "", MI_NAME_DEXT, 4); fn_format(from, from, "", MI_NAME_DEXT, 4);
sprintf(tmp,"%s-%lx_%lx", from, current_pid, thd->thread_id); sprintf(tmp,"%s-%lx_%lx", from, current_pid, thd->thread_id);
pthread_mutex_lock(&LOCK_open);
close_cached_table(thd,table->table); close_cached_table(thd,table->table);
pthread_mutex_unlock(&LOCK_open);
if (lock_and_wait_for_table_name(thd,table)) if (lock_and_wait_for_table_name(thd,table))
DBUG_RETURN(-1); 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