diff options
Diffstat (limited to 'storage/myisam')
-rw-r--r-- | storage/myisam/TODO | 7 | ||||
-rw-r--r-- | storage/myisam/mi_check.c | 4 | ||||
-rw-r--r-- | storage/myisam/mi_extra.c | 5 | ||||
-rw-r--r-- | storage/myisam/mi_locking.c | 6 | ||||
-rw-r--r-- | storage/myisam/myisamdef.h | 1 |
5 files changed, 14 insertions, 9 deletions
diff --git a/storage/myisam/TODO b/storage/myisam/TODO deleted file mode 100644 index cad9486e1bb..00000000000 --- a/storage/myisam/TODO +++ /dev/null @@ -1,7 +0,0 @@ -TODO: - -- Let packisam find the optimal way to store keys. -- kill when using 'myisamchk' should remove all temporary files. -- Text search index - (Sergei A. Golub is working on this) -- Add '%' packed to myisamchk for compressed tables with blobs. diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index f6929438ac0..01078c2a264 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -102,6 +102,9 @@ int chk_status(HA_CHECK *param, register MI_INFO *info) { MYISAM_SHARE *share=info->s; + /* Protection for HA_EXTRA_FLUSH */ + mysql_mutex_lock(&share->intern_lock); + if (mi_is_crashed_on_repair(info)) mi_check_print_warning(param, "Table is marked as crashed and last repair failed"); @@ -121,6 +124,7 @@ int chk_status(HA_CHECK *param, register MI_INFO *info) if (param->testflag & T_UPDATE_STATE) param->warning_printed=save; } + mysql_mutex_unlock(&share->intern_lock); return 0; } diff --git a/storage/myisam/mi_extra.c b/storage/myisam/mi_extra.c index c10bf61a477..194ad5bf07a 100644 --- a/storage/myisam/mi_extra.c +++ b/storage/myisam/mi_extra.c @@ -332,7 +332,11 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) if (!share->temporary) flush_key_blocks(share->key_cache, share->kfile, &share->dirty_part_map, FLUSH_KEEP); + mysql_mutex_lock(&share->intern_lock); + /* Tell mi_lock_database() that we locked the intern_lock mutex */ + info->intern_lock_locked= 1; _mi_decrement_open_count(info); + info->intern_lock_locked= 0; if (share->not_flushed) { share->not_flushed=0; @@ -349,6 +353,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) } if (share->base.blobs) mi_alloc_rec_buff(info, -1, &info->rec_buff); + mysql_mutex_unlock(&share->intern_lock); break; case HA_EXTRA_NORMAL: /* Theese isn't in use */ info->quick_mode=0; diff --git a/storage/myisam/mi_locking.c b/storage/myisam/mi_locking.c index b348429fd3c..f3030148044 100644 --- a/storage/myisam/mi_locking.c +++ b/storage/myisam/mi_locking.c @@ -53,7 +53,8 @@ int mi_lock_database(MI_INFO *info, int lock_type) error= 0; DBUG_EXECUTE_IF ("mi_lock_database_failure", error= EINVAL;); - mysql_mutex_lock(&share->intern_lock); + if (!info->intern_lock_locked) + mysql_mutex_lock(&share->intern_lock); if (share->kfile >= 0) /* May only be false on windows */ { switch (lock_type) { @@ -261,7 +262,8 @@ int mi_lock_database(MI_INFO *info, int lock_type) } } #endif - mysql_mutex_unlock(&share->intern_lock); + if (!info->intern_lock_locked) + mysql_mutex_unlock(&share->intern_lock); if (mark_crashed) mi_mark_crashed(info); DBUG_RETURN(error); diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h index e350626f192..2f8d52863fc 100644 --- a/storage/myisam/myisamdef.h +++ b/storage/myisam/myisamdef.h @@ -296,6 +296,7 @@ struct st_myisam_info uint preload_buff_size; /* When preloading indexes */ myf lock_wait; /* is 0 or MY_SHORT_WAIT */ my_bool was_locked; /* Was locked in panic */ + my_bool intern_lock_locked; /* locked in mi_extra() */ my_bool append_insert_at_end; /* Set if concurrent insert */ my_bool quick_mode; /* If info->buff can't be used for rnext */ |