summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorramil/ram@mysql.com/ramil.myoffice.izhnet.ru <>2008-03-28 19:16:52 +0400
committerramil/ram@mysql.com/ramil.myoffice.izhnet.ru <>2008-03-28 19:16:52 +0400
commitf538288bcacf2e1cf5f9c08ba0a57c0d28b18159 (patch)
tree928d36536678630f85f55c212679a67535017a6e /storage
parentab82eca67c58b1ce973fba7afab06c3ba3b53fdd (diff)
downloadmariadb-git-f538288bcacf2e1cf5f9c08ba0a57c0d28b18159.tar.gz
Fix for bug #35392: Delete all statement does not execute properly
after few delete statements Problem: changing a file size might require that it must be unmapped beforehand. Fix: unmap the file before changing its size.
Diffstat (limited to 'storage')
-rw-r--r--storage/myisam/mi_delete_all.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/storage/myisam/mi_delete_all.c b/storage/myisam/mi_delete_all.c
index dea0385cbca..e2bbb04ab3c 100644
--- a/storage/myisam/mi_delete_all.c
+++ b/storage/myisam/mi_delete_all.c
@@ -53,15 +53,18 @@ int mi_delete_all_rows(MI_INFO *info)
since it was locked then there may be key blocks in the key cache
*/
flush_key_blocks(share->key_cache, share->kfile, FLUSH_IGNORE_CHANGED);
+#ifdef HAVE_MMAP
+ if (share->file_map)
+ _mi_unmap_file(info);
+#endif
if (my_chsize(info->dfile, 0, 0, MYF(MY_WME)) ||
my_chsize(share->kfile, share->base.keystart, 0, MYF(MY_WME)) )
goto err;
VOID(_mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE));
#ifdef HAVE_MMAP
- /* Resize mmaped area */
- rw_wrlock(&info->s->mmap_lock);
- mi_remap_file(info, (my_off_t)0);
- rw_unlock(&info->s->mmap_lock);
+ /* Map again */
+ if (share->file_map)
+ mi_dynmap_file(info, (my_off_t) 0);
#endif
allow_break(); /* Allow SIGHUP & SIGINT */
DBUG_RETURN(0);