summaryrefslogtreecommitdiff
path: root/myisam/mi_locking.c
diff options
context:
space:
mode:
Diffstat (limited to 'myisam/mi_locking.c')
-rw-r--r--myisam/mi_locking.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/myisam/mi_locking.c b/myisam/mi_locking.c
index 6f996ab5abd..2056b018a16 100644
--- a/myisam/mi_locking.c
+++ b/myisam/mi_locking.c
@@ -34,7 +34,6 @@ int mi_lock_database(MI_INFO *info, int lock_type)
uint count;
MYISAM_SHARE *share=info->s;
uint flag;
- uint switch_fl= 0;
DBUG_ENTER("mi_lock_database");
DBUG_PRINT("info",("lock_type: %d", lock_type));
@@ -61,21 +60,13 @@ int mi_lock_database(MI_INFO *info, int lock_type)
else
count= --share->w_locks;
--share->tot_locks;
- /*
- During a key cache reassignment the current and registered
- key caches for the table are different.
- */
if (info->lock_type == F_WRLCK && !share->w_locks &&
- ((switch_fl= share->keycache != share->reg_keycache) ||
- !share->delay_key_write) &&
- flush_key_blocks(*share->keycache, share->kfile,
- switch_fl ? FLUSH_REMOVE : FLUSH_KEEP))
+ !share->delay_key_write && flush_key_blocks(*share->key_cache,
+ share->kfile,FLUSH_KEEP))
{
error=my_errno;
mi_mark_crashed(info); /* Mark that table must be checked */
}
- if (switch_fl)
- share->keycache= share->reg_keycache;
if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED))
{
if (end_io_cache(&info->rec_cache))
@@ -398,7 +389,7 @@ int _mi_test_if_changed(register MI_INFO *info)
{ /* Keyfile has changed */
DBUG_PRINT("info",("index file changed"));
if (share->state.process != share->this_process)
- VOID(flush_key_blocks(*share->keycache,share->kfile,FLUSH_RELEASE));
+ VOID(flush_key_blocks(*share->key_cache, share->kfile, FLUSH_RELEASE));
share->last_process=share->state.process;
info->last_unique= share->state.unique;
info->last_loop= share->state.update_count;