mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
Merge of patch for bug#11756764 from mysql-5.1.
This commit is contained in:
commit
756416f645
2 changed files with 10 additions and 4 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue