From 000ae475aabf21052696b0a68cc2489d523385a6 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 1 Dec 2005 13:34:48 +0100 Subject: Many files: Added mmap support for MyISAM engine configure.in: Added mmap support for MyISAM engine include/my_base.h: Added mmap support for MyISAM engine include/my_sys.h: Added mmap support for MyISAM engine sql/ha_myisam.cc: Added mmap support for MyISAM engine sql/mysql_priv.h: Added mmap support for MyISAM engine sql/mysqld.cc: Added mmap support for MyISAM engine sql/records.cc: Added mmap support for MyISAM engine sql/set_var.cc: Added mmap support for MyISAM engine storage/myisam/mi_close.c: Added mmap support for MyISAM engine storage/myisam/mi_delete_all.c: Added mmap support for MyISAM engine storage/myisam/mi_dynrec.c: Added mmap support for MyISAM engine storage/myisam/mi_extra.c: Added mmap support for MyISAM engine storage/myisam/mi_locking.c: Added mmap support for MyISAM engine storage/myisam/mi_open.c: Added mmap support for MyISAM engine storage/myisam/mi_packrec.c: Added mmap support for MyISAM engine storage/myisam/mi_statrec.c: Added mmap support for MyISAM engine storage/myisam/myisamdef.h: Added mmap support for MyISAM engine --- storage/myisam/mi_locking.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'storage/myisam/mi_locking.c') diff --git a/storage/myisam/mi_locking.c b/storage/myisam/mi_locking.c index 8d48c5242e5..5d871aa1e38 100644 --- a/storage/myisam/mi_locking.c +++ b/storage/myisam/mi_locking.c @@ -38,7 +38,6 @@ int mi_lock_database(MI_INFO *info, int lock_type) share->w_locks, share->global_changed, share->state.open_count, share->index_file_name)); - if (share->options & HA_OPTION_READ_ONLY_DATA || info->lock_type == lock_type) DBUG_RETURN(0); @@ -84,6 +83,14 @@ int mi_lock_database(MI_INFO *info, int lock_type) (uint) share->changed, share->w_locks)); if (share->changed && !share->w_locks) { + if (info->s->mmaped_length != info->s->state.state.data_file_length) + { + if (info->s->concurrent_insert) + rw_wrlock(&info->s->mmap_lock); + mi_remap_file(info, info->s->state.state.data_file_length); + if (info->s->concurrent_insert) + rw_unlock(&info->s->mmap_lock); + } share->state.process= share->last_process=share->this_process; share->state.unique= info->last_unique= info->this_unique; share->state.update_count= info->last_loop= ++info->this_loop; @@ -215,6 +222,7 @@ int mi_lock_database(MI_INFO *info, int lock_type) } } VOID(_mi_test_if_changed(info)); + info->lock_type=lock_type; info->invalidator=info->s->invalidator; share->w_locks++; -- cgit v1.2.1