summaryrefslogtreecommitdiff
path: root/storage/myisam
diff options
context:
space:
mode:
authorunknown <istruewing@chilla.local>2007-02-22 09:12:07 +0100
committerunknown <istruewing@chilla.local>2007-02-22 09:12:07 +0100
commitb3a28c0883c7dd967a47d133becb9dc8e75ed522 (patch)
treecada93f2068ddf9aa0869b472d5f5642b30511b2 /storage/myisam
parent837188e61b1def5043b9cffdad8404b7bdd49a37 (diff)
downloadmariadb-git-b3a28c0883c7dd967a47d133becb9dc8e75ed522.tar.gz
Bug#25460 - High concurrency MyISAM access causes severe mysqld crash.
Decreased code duplication by calling memory mapping function through mi_extra().
Diffstat (limited to 'storage/myisam')
-rw-r--r--storage/myisam/mi_open.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c
index 830332fe0c1..a06b21ee5b4 100644
--- a/storage/myisam/mi_open.c
+++ b/storage/myisam/mi_open.c
@@ -506,22 +506,6 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
share->data_file_type = DYNAMIC_RECORD;
my_afree((gptr) disk_cache);
mi_setup_functions(share);
- if (open_flags & HA_OPEN_MMAP)
- {
- info.s= share;
- if (mi_dynmap_file(&info, share->state.state.data_file_length))
- {
- /* purecov: begin inspected */
- /* Ignore if mmap fails. Use file I/O instead. */
- DBUG_PRINT("warning", ("mmap failed: errno: %d", errno));
- /* purecov: end */
- }
- else
- {
- share->file_read= mi_mmap_pread;
- share->file_write= mi_mmap_pwrite;
- }
- }
share->is_log_table= FALSE;
#ifdef THREAD
thr_lock_init(&share->lock);
@@ -552,6 +536,14 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
}
}
#endif
+ /*
+ Memory mapping can only be requested after initializing intern_lock.
+ */
+ if (open_flags & HA_OPEN_MMAP)
+ {
+ info.s= share;
+ mi_extra(&info, HA_EXTRA_MMAP, 0);
+ }
}
else
{