diff options
author | Igor Babaev <igor@askmonty.org> | 2019-02-03 18:41:18 -0800 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2019-02-03 18:41:18 -0800 |
commit | 37deed3f37561f264f65e162146bbc2ad35fb1a2 (patch) | |
tree | c1cfb6c0995bfcc4ac3fb335f518a8b404413e32 /storage/myisam | |
parent | 658128af43b4d7c6db445164f8ed25ed4d1e3109 (diff) | |
parent | 5b996782be6b752ce50a0ecaa222b0688aa9e75d (diff) | |
download | mariadb-git-37deed3f37561f264f65e162146bbc2ad35fb1a2.tar.gz |
Merge branch '10.4' into bb-10.4-mdev16188
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 e28b9be501e..15f0297002f 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 d51e0f9f9e1..8ba2bbcc209 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 */ |