diff options
author | Michael Widenius <monty@askmonty.org> | 2009-10-06 09:13:56 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2009-10-06 09:13:56 +0300 |
commit | e147ca15617a4f7d3d1ce328c054540dc2fda46d (patch) | |
tree | 3f6386323c63341ce7b7ece214dba278c5d95e7c /storage/myisam/mi_extra.c | |
parent | 820c4902a9ddc48a37087c4b828f5e8b7df65cf3 (diff) | |
download | mariadb-git-e147ca15617a4f7d3d1ce328c054540dc2fda46d.tar.gz |
Don't call _ma_decrement_open_count() for ma_extra(HA_EXTRA_PREPARE_FOR_DROP).
Don't call _mi_decrement_open_count() for mi_extra(HA_EXTRA_PREPARE_FOR_DROP).
This ensures that if we empty the key cache and a drop table fails later, the index will be automaticly rebuilt
storage/maria/ma_extra.c:
Don't call _ma_decrement_open_count() for ma_extra(HA_EXTRA_PREPARE_FOR_DROP).
This ensures that if we empty the key cache and a drop table fails later, the index will be automaticly rebuilt
storage/maria/ma_locking.c:
Simple optimization: Don't call maria_lock_database() if locking is disabled
storage/myisam/mi_extra.c:
Don't call _mi_decrement_open_count() for mi_extra(HA_EXTRA_PREPARE_FOR_DROP).
Simplify code to remove if
Diffstat (limited to 'storage/myisam/mi_extra.c')
-rw-r--r-- | storage/myisam/mi_extra.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/storage/myisam/mi_extra.c b/storage/myisam/mi_extra.c index 239fdb3fbc4..9c5dade28ab 100644 --- a/storage/myisam/mi_extra.c +++ b/storage/myisam/mi_extra.c @@ -286,9 +286,19 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) info->lock_type = F_UNLCK; } if (share->kfile >= 0) + { + /* + We don't need to call _mi_decrement_open_count() if we are + dropping the table, as the files will be removed anyway. If we + are aborted before the files is removed, it's better to not + call it as in that case the automatic repair on open will add + the missing index entries + */ + if (function != HA_EXTRA_PREPARE_FOR_DROP) _mi_decrement_open_count(info); - if (share->kfile >= 0 && my_close(share->kfile,MYF(0))) - error=my_errno; + if (my_close(share->kfile,MYF(0))) + error=my_errno; + } { LIST *list_element ; for (list_element=myisam_open_list ; |