Loading myisam/mi_check.c +6 −3 Original line number Diff line number Diff line Loading @@ -1551,7 +1551,7 @@ int mi_sort_index(MI_CHECK *param, register MI_INFO *info, my_string name) old_state=share->state; /* save state if not stored */ r_locks=share->r_locks; w_locks=share->w_locks; /* Put same locks as old file */ share->r_locks=share->w_locks=0; share->r_locks= share->w_locks= share->tot_locks= 0; (void) _mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE); VOID(my_close(share->kfile,MYF(MY_WME))); share->kfile = -1; Loading @@ -1564,6 +1564,7 @@ int mi_sort_index(MI_CHECK *param, register MI_INFO *info, my_string name) _mi_readinfo(info,F_WRLCK,0); /* Will lock the table */ info->lock_type=F_WRLCK; share->r_locks=r_locks; share->w_locks=w_locks; share->tot_locks= r_locks+w_locks; share->state=old_state; /* Restore old state */ info->state->key_file_length=param->new_file_pos; Loading Loading @@ -3139,9 +3140,11 @@ int update_state_info(MI_CHECK *param, MI_INFO *info,uint update) { /* Force update of status */ int error; uint r_locks=share->r_locks,w_locks=share->w_locks; share->r_locks=share->w_locks=0; share->r_locks= share->w_locks= share->tot_locks= 0; error=_mi_writeinfo(info,WRITEINFO_NO_UNLOCK); share->r_locks=r_locks; share->w_locks=w_locks; share->r_locks=r_locks; share->w_locks=w_locks; share->tot_locks=r_locks+w_locks; if (!error) return 0; } Loading myisam/mi_close.c +4 −2 Original line number Diff line number Diff line Loading @@ -29,8 +29,7 @@ int mi_close(register MI_INFO *info) MYISAM_SHARE *share=info->s; DBUG_ENTER("mi_close"); DBUG_PRINT("enter",("base: %lx reopen: %u locks: %u", info,(uint) share->reopen, (uint) (share->w_locks+share->r_locks))); info,(uint) share->reopen, (uint) share->tot_locks)); pthread_mutex_lock(&THR_LOCK_myisam); if (info->lock_type == F_EXTRA_LCK) Loading @@ -47,7 +46,10 @@ int mi_close(register MI_INFO *info) pthread_mutex_lock(&share->intern_lock); if (share->options & HA_OPTION_READ_ONLY_DATA) { share->r_locks--; share->tot_locks--; } if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED)) { if (end_io_cache(&info->rec_cache)) Loading myisam/mi_dynrec.c +1 −1 Original line number Diff line number Diff line Loading @@ -1275,7 +1275,7 @@ int _mi_read_rnd_dynamic_record(MI_INFO *info, byte *buf, if (info->lock_type == F_UNLCK) { #ifndef UNSAFE_LOCKING if (share->r_locks == 0 && share->w_locks == 0) if (share->tot_locks == 0) { if (my_lock(share->kfile,F_RDLCK,0L,F_TO_EOF, MYF(MY_SEEK_NOT_DONE) | info->lock_wait)) Loading myisam/mi_open.c +2 −0 Original line number Diff line number Diff line Loading @@ -486,6 +486,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) { info.lock_type=F_RDLCK; share->r_locks++; share->tot_locks++; } if ((open_flags & HA_OPEN_TMP_TABLE) || (share->options & HA_OPTION_TMP_TABLE)) Loading @@ -493,6 +494,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) share->temporary=share->delay_key_write=1; share->write_flag=MYF(MY_NABP); share->w_locks++; /* We don't have to update status */ share->tot_locks++; info.lock_type=F_WRLCK; } if (((open_flags & HA_OPEN_DELAY_KEY_WRITE) || Loading myisam/mi_statrec.c +1 −1 Original line number Diff line number Diff line Loading @@ -239,7 +239,7 @@ int _mi_read_rnd_static_record(MI_INFO *info, byte *buf, { /* We don't nead new info */ #ifndef UNSAFE_LOCKING if ((! cache_read || share->base.reclength > cache_length) && share->r_locks == 0 && share->w_locks == 0) share->tot_locks == 0) { /* record not in cache */ if (my_lock(share->kfile,F_RDLCK,0L,F_TO_EOF, MYF(MY_SEEK_NOT_DONE) | info->lock_wait)) Loading Loading
myisam/mi_check.c +6 −3 Original line number Diff line number Diff line Loading @@ -1551,7 +1551,7 @@ int mi_sort_index(MI_CHECK *param, register MI_INFO *info, my_string name) old_state=share->state; /* save state if not stored */ r_locks=share->r_locks; w_locks=share->w_locks; /* Put same locks as old file */ share->r_locks=share->w_locks=0; share->r_locks= share->w_locks= share->tot_locks= 0; (void) _mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE); VOID(my_close(share->kfile,MYF(MY_WME))); share->kfile = -1; Loading @@ -1564,6 +1564,7 @@ int mi_sort_index(MI_CHECK *param, register MI_INFO *info, my_string name) _mi_readinfo(info,F_WRLCK,0); /* Will lock the table */ info->lock_type=F_WRLCK; share->r_locks=r_locks; share->w_locks=w_locks; share->tot_locks= r_locks+w_locks; share->state=old_state; /* Restore old state */ info->state->key_file_length=param->new_file_pos; Loading Loading @@ -3139,9 +3140,11 @@ int update_state_info(MI_CHECK *param, MI_INFO *info,uint update) { /* Force update of status */ int error; uint r_locks=share->r_locks,w_locks=share->w_locks; share->r_locks=share->w_locks=0; share->r_locks= share->w_locks= share->tot_locks= 0; error=_mi_writeinfo(info,WRITEINFO_NO_UNLOCK); share->r_locks=r_locks; share->w_locks=w_locks; share->r_locks=r_locks; share->w_locks=w_locks; share->tot_locks=r_locks+w_locks; if (!error) return 0; } Loading
myisam/mi_close.c +4 −2 Original line number Diff line number Diff line Loading @@ -29,8 +29,7 @@ int mi_close(register MI_INFO *info) MYISAM_SHARE *share=info->s; DBUG_ENTER("mi_close"); DBUG_PRINT("enter",("base: %lx reopen: %u locks: %u", info,(uint) share->reopen, (uint) (share->w_locks+share->r_locks))); info,(uint) share->reopen, (uint) share->tot_locks)); pthread_mutex_lock(&THR_LOCK_myisam); if (info->lock_type == F_EXTRA_LCK) Loading @@ -47,7 +46,10 @@ int mi_close(register MI_INFO *info) pthread_mutex_lock(&share->intern_lock); if (share->options & HA_OPTION_READ_ONLY_DATA) { share->r_locks--; share->tot_locks--; } if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED)) { if (end_io_cache(&info->rec_cache)) Loading
myisam/mi_dynrec.c +1 −1 Original line number Diff line number Diff line Loading @@ -1275,7 +1275,7 @@ int _mi_read_rnd_dynamic_record(MI_INFO *info, byte *buf, if (info->lock_type == F_UNLCK) { #ifndef UNSAFE_LOCKING if (share->r_locks == 0 && share->w_locks == 0) if (share->tot_locks == 0) { if (my_lock(share->kfile,F_RDLCK,0L,F_TO_EOF, MYF(MY_SEEK_NOT_DONE) | info->lock_wait)) Loading
myisam/mi_open.c +2 −0 Original line number Diff line number Diff line Loading @@ -486,6 +486,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) { info.lock_type=F_RDLCK; share->r_locks++; share->tot_locks++; } if ((open_flags & HA_OPEN_TMP_TABLE) || (share->options & HA_OPTION_TMP_TABLE)) Loading @@ -493,6 +494,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) share->temporary=share->delay_key_write=1; share->write_flag=MYF(MY_NABP); share->w_locks++; /* We don't have to update status */ share->tot_locks++; info.lock_type=F_WRLCK; } if (((open_flags & HA_OPEN_DELAY_KEY_WRITE) || Loading
myisam/mi_statrec.c +1 −1 Original line number Diff line number Diff line Loading @@ -239,7 +239,7 @@ int _mi_read_rnd_static_record(MI_INFO *info, byte *buf, { /* We don't nead new info */ #ifndef UNSAFE_LOCKING if ((! cache_read || share->base.reclength > cache_length) && share->r_locks == 0 && share->w_locks == 0) share->tot_locks == 0) { /* record not in cache */ if (my_lock(share->kfile,F_RDLCK,0L,F_TO_EOF, MYF(MY_SEEK_NOT_DONE) | info->lock_wait)) Loading