diff options
author | Sergey Vojtovich <svoj@sun.com> | 2010-03-26 14:21:10 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@sun.com> | 2010-03-26 14:21:10 +0400 |
commit | 3569fe776fbaf0a750b054b0684d37d7cefeaa94 (patch) | |
tree | 07a1acfcb5224d388cb27c513fab6aa16802abf8 /storage/myisam/mi_dynrec.c | |
parent | bded6a7fe32e4085cd860f65272bf0b90b89741f (diff) | |
parent | b602127bf0225b7a33b44c1d7c7e1f06f8f4dee7 (diff) | |
download | mariadb-git-3569fe776fbaf0a750b054b0684d37d7cefeaa94.tar.gz |
Merge fix for BUG51868 to mysql-5.1-bugteam.
Diffstat (limited to 'storage/myisam/mi_dynrec.c')
-rw-r--r-- | storage/myisam/mi_dynrec.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/storage/myisam/mi_dynrec.c b/storage/myisam/mi_dynrec.c index 6518d874f4f..09152f8d013 100644 --- a/storage/myisam/mi_dynrec.c +++ b/storage/myisam/mi_dynrec.c @@ -94,6 +94,34 @@ my_bool mi_dynmap_file(MI_INFO *info, my_off_t size) madvise((char*) info->s->file_map, size, MADV_RANDOM); #endif info->s->mmaped_length= size; + info->s->file_read= mi_mmap_pread; + info->s->file_write= mi_mmap_pwrite; + DBUG_RETURN(0); +} + + +/* + Destroy mmaped area for MyISAM handler + + SYNOPSIS + mi_munmap_file() + info MyISAM handler + + RETURN + 0 ok + !0 error. +*/ + +int mi_munmap_file(MI_INFO *info) +{ + int ret; + DBUG_ENTER("mi_unmap_file"); + if ((ret= my_munmap(info->s->file_map, info->s->mmaped_length))) + DBUG_RETURN(ret); + info->s->file_read= mi_nommap_pread; + info->s->file_write= mi_nommap_pwrite; + info->s->file_map= 0; + info->s->mmaped_length= 0; DBUG_RETURN(0); } @@ -112,8 +140,7 @@ void mi_remap_file(MI_INFO *info, my_off_t size) { if (info->s->file_map) { - VOID(my_munmap((char*) info->s->file_map, - (size_t) info->s->mmaped_length)); + mi_munmap_file(info); mi_dynmap_file(info, size); } } |