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
This commit is contained in:
unknown 2002-09-01 18:17:33 +00:00
parent b12cc1ab20
commit 9af502edd2
3 changed files with 17 additions and 0 deletions

View file

@ -0,0 +1,7 @@
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;

8
mysql-test/t/repair.test Normal file
View file

@ -0,0 +1,8 @@
#
# 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;

View file

@ -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);