diff options
Diffstat (limited to 'myisam/mi_close.c')
-rw-r--r-- | myisam/mi_close.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/myisam/mi_close.c b/myisam/mi_close.c index bd8b9aff727..dbaaebb1143 100644 --- a/myisam/mi_close.c +++ b/myisam/mi_close.c @@ -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) @@ -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)) @@ -58,6 +60,7 @@ int mi_close(register MI_INFO *info) myisam_open_list=list_delete(myisam_open_list,&info->open_list); pthread_mutex_unlock(&share->intern_lock); + my_free(mi_get_rec_buff_ptr(info, info->rec_buff), MYF(MY_ALLOW_ZERO_PTR)); if (flag) { if (share->kfile >= 0 && @@ -99,7 +102,6 @@ int mi_close(register MI_INFO *info) error = my_errno; myisam_log_command(MI_LOG_CLOSE,info,NULL,0,error); - my_free((gptr) info->rec_alloc,MYF(MY_ALLOW_ZERO_PTR)); my_free((gptr) info,MYF(0)); if (error) |