summaryrefslogtreecommitdiff
path: root/storage/myisam
diff options
context:
space:
mode:
Diffstat (limited to 'storage/myisam')
-rw-r--r--storage/myisam/mi_close.c7
-rw-r--r--storage/myisam/mi_packrec.c7
2 files changed, 10 insertions, 4 deletions
diff --git a/storage/myisam/mi_close.c b/storage/myisam/mi_close.c
index 61504ec31ab..ce516ac4761 100644
--- a/storage/myisam/mi_close.c
+++ b/storage/myisam/mi_close.c
@@ -84,7 +84,12 @@ int mi_close(register MI_INFO *info)
}
#ifdef HAVE_MMAP
if (share->file_map)
- _mi_unmap_file(info);
+ {
+ if (share->options & HA_OPTION_COMPRESS_RECORD)
+ _mi_unmap_file(info);
+ else
+ mi_munmap_file(info);
+ }
#endif
if (share->decode_trees)
{
diff --git a/storage/myisam/mi_packrec.c b/storage/myisam/mi_packrec.c
index 3d9acd45106..33c6d55e6ad 100644
--- a/storage/myisam/mi_packrec.c
+++ b/storage/myisam/mi_packrec.c
@@ -1549,13 +1549,14 @@ my_bool _mi_memmap_file(MI_INFO *info)
void _mi_unmap_file(MI_INFO *info)
{
- (void) my_munmap((char*) info->s->file_map,
- (size_t) info->s->mmaped_length + MEMMAP_EXTRA_MARGIN);
+ DBUG_ASSERT(info->s->options & HA_OPTION_COMPRESS_RECORD);
+
+ (void) my_munmap((char*) info->s->file_map, (size_t) info->s->mmaped_length);
if (myisam_mmap_size != SIZE_T_MAX)
{
mysql_mutex_lock(&THR_LOCK_myisam_mmap);
- myisam_mmap_used-= info->s->mmaped_length + MEMMAP_EXTRA_MARGIN;
+ myisam_mmap_used-= info->s->mmaped_length;
mysql_mutex_unlock(&THR_LOCK_myisam_mmap);
}
}