summaryrefslogtreecommitdiff
path: root/storage/maria/ma_delete_all.c
diff options
context:
space:
mode:
Diffstat (limited to 'storage/maria/ma_delete_all.c')
-rw-r--r--storage/maria/ma_delete_all.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/storage/maria/ma_delete_all.c b/storage/maria/ma_delete_all.c
index e1d04997281..c1019c01c66 100644
--- a/storage/maria/ma_delete_all.c
+++ b/storage/maria/ma_delete_all.c
@@ -38,6 +38,9 @@ int maria_delete_all_rows(MARIA_HA *info)
MARIA_SHARE *share= info->s;
my_bool log_record;
LSN lsn;
+#ifdef HAVE_MMAP
+ my_bool mmap_file= share->file_map != 0;
+#endif
DBUG_ENTER("maria_delete_all_rows");
if (share->options & HA_OPTION_READ_ONLY_DATA)
@@ -95,7 +98,7 @@ int maria_delete_all_rows(MARIA_HA *info)
*/
#ifdef HAVE_MMAP
- if (share->file_map)
+ if (mmap_file)
_ma_unmap_file(info);
#endif
@@ -135,10 +138,13 @@ int maria_delete_all_rows(MARIA_HA *info)
goto err;
}
+ if (info->opt_flag & WRITE_CACHE_USED)
+ reinit_io_cache(&info->rec_cache, WRITE_CACHE, 0, 1, 1);
+
_ma_writeinfo(info, WRITEINFO_UPDATE_KEYFILE);
#ifdef HAVE_MMAP
/* Map again */
- if (share->file_map)
+ if (mmap_file)
_ma_dynmap_file(info, (my_off_t) 0);
#endif
DBUG_RETURN(0);