summaryrefslogtreecommitdiff
path: root/storage/myisam
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay.choubey@oracle.com>2011-11-29 19:31:51 +0530
committerNirbhay Choubey <nirbhay.choubey@oracle.com>2011-11-29 19:31:51 +0530
commitc7ac6191cd74fa808942efd0c0e7728d7d539c93 (patch)
treef55b3f45cde6517737cb525a81fad679e1808d13 /storage/myisam
parentb3ffe9132bdbc3981560152ea441d1f01481d27b (diff)
parentc9761d0872366e79e7a17c726a1d4fcb14e8f663 (diff)
downloadmariadb-git-c7ac6191cd74fa808942efd0c0e7728d7d539c93.tar.gz
Merge of patch for bug#11756764 from mysql-5.1.
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);
}
}