summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
Diffstat (limited to 'myisam')
-rw-r--r--myisam/mi_check.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/myisam/mi_check.c b/myisam/mi_check.c
index d59c9b9c697..60a2b664c70 100644
--- a/myisam/mi_check.c
+++ b/myisam/mi_check.c
@@ -3870,6 +3870,14 @@ int update_state_info(MI_CHECK *param, MI_INFO *info,uint update)
if (!share->state.create_time)
share->state.create_time=share->state.check_time;
}
+ /*
+ When tables are locked we haven't synched the share state and the
+ real state for a while so we better do it here before synching
+ the share state to disk. Only when table is write locked is it
+ necessary to perform this synch.
+ */
+ if (info->lock_type == F_WRLCK)
+ share->state.state= *info->state;
if (mi_state_info_write(share->kfile,&share->state,1+2))
goto err;
share->changed=0;