summaryrefslogtreecommitdiff
path: root/storage/myisam
diff options
context:
space:
mode:
authorSergey Vojtovich <sergey.vojtovich@oracle.com>2011-10-21 09:35:07 +0400
committerSergey Vojtovich <sergey.vojtovich@oracle.com>2011-10-21 09:35:07 +0400
commitafdfc6acf99872e9887e8b6b001a9c6227c9c20e (patch)
treec06c4e1f57daf52d46be75d1afe9d8e24f90dd30 /storage/myisam
parentf6064041d29781e1f665e79e2d79fd6e99476a5d (diff)
parente1c4021bde046618699d52399a2b9a081f328a64 (diff)
downloadmariadb-git-afdfc6acf99872e9887e8b6b001a9c6227c9c20e.tar.gz
Merge.
Diffstat (limited to 'storage/myisam')
-rw-r--r--storage/myisam/ha_myisam.cc16
-rw-r--r--storage/myisam/mi_delete_all.c5
2 files changed, 16 insertions, 5 deletions
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index b2b64054cf9..47ca430d160 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -1026,6 +1026,18 @@ int ha_myisam::repair(THD *thd, MI_CHECK &param, bool do_optimize)
mi_get_mask_all_keys_active(share->base.keys) :
share->state.key_map);
uint testflag=param.testflag;
+#ifdef HAVE_MMAP
+ bool remap= test(share->file_map);
+ /*
+ mi_repair*() functions family use file I/O even if memory
+ mapping is available.
+
+ Since mixing mmap I/O and file I/O may cause various artifacts,
+ memory mapping must be disabled.
+ */
+ if (remap)
+ mi_munmap_file(file);
+#endif
if (mi_test_if_sort_rep(file,file->state->records,key_map,0) &&
(local_testflag & T_REP_BY_SORT))
{
@@ -1057,6 +1069,10 @@ int ha_myisam::repair(THD *thd, MI_CHECK &param, bool do_optimize)
error= mi_repair(&param, file, fixed_name,
param.testflag & T_QUICK);
}
+#ifdef HAVE_MMAP
+ if (remap)
+ mi_dynmap_file(file, file->state->data_file_length);
+#endif
param.testflag=testflag;
optimize_done=1;
}
diff --git a/storage/myisam/mi_delete_all.c b/storage/myisam/mi_delete_all.c
index dc9fa0981ba..3530af3eca1 100644
--- a/storage/myisam/mi_delete_all.c
+++ b/storage/myisam/mi_delete_all.c
@@ -61,11 +61,6 @@ int mi_delete_all_rows(MI_INFO *info)
mysql_file_chsize(share->kfile, share->base.keystart, 0, MYF(MY_WME)))
goto err;
(void) _mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE);
-#ifdef HAVE_MMAP
- /* Map again */
- if (share->file_map)
- mi_dynmap_file(info, (my_off_t) 0);
-#endif
DBUG_RETURN(0);
err: