diff options
author | Satya B <satya.bn@sun.com> | 2009-04-06 12:31:17 +0530 |
---|---|---|
committer | Satya B <satya.bn@sun.com> | 2009-04-06 12:31:17 +0530 |
commit | 58fa483a2007fc962e1dea79e1d525bd85bf8cc8 (patch) | |
tree | 1273f1bc4917d08295c6ea3e4e425f4045205997 /storage/myisam | |
parent | ff9803acea8e7270e1b58f8221fbcd902580e052 (diff) | |
parent | b1d74c9b5c01b3ff91e4199ab9146b4baec4e163 (diff) | |
download | mariadb-git-58fa483a2007fc962e1dea79e1d525bd85bf8cc8.tar.gz |
merge 5.0-bugteam to 5.1-bugteam
Diffstat (limited to 'storage/myisam')
-rw-r--r-- | storage/myisam/mi_close.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/storage/myisam/mi_close.c b/storage/myisam/mi_close.c index 07105aea88d..2066d092e1f 100644 --- a/storage/myisam/mi_close.c +++ b/storage/myisam/mi_close.c @@ -35,9 +35,6 @@ int mi_close(register MI_INFO *info) if (info->lock_type == F_EXTRA_LCK) info->lock_type=F_UNLCK; /* HA_EXTRA_NO_USER_CHANGE */ - if (share->reopen == 1 && share->kfile >= 0) - _mi_decrement_open_count(info); - if (info->lock_type != F_UNLCK) { if (mi_lock_database(info,F_UNLCK)) @@ -63,6 +60,8 @@ int mi_close(register MI_INFO *info) my_free(mi_get_rec_buff_ptr(info, info->rec_buff), MYF(MY_ALLOW_ZERO_PTR)); if (flag) { + DBUG_EXECUTE_IF("crash_before_flush_keys", + if (share->kfile >= 0) abort();); if (share->kfile >= 0 && flush_key_blocks(share->key_cache, share->kfile, share->temporary ? FLUSH_IGNORE_CHANGED : @@ -78,6 +77,8 @@ int mi_close(register MI_INFO *info) */ if (share->mode != O_RDONLY && mi_is_crashed(info)) mi_state_info_write(share->kfile, &share->state, 1); + /* Decrement open count must be last I/O on this file. */ + _mi_decrement_open_count(info); if (my_close(share->kfile,MYF(0))) error = my_errno; } |