diff options
Diffstat (limited to 'storage/maria/maria_pack.c')
-rw-r--r-- | storage/maria/maria_pack.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/storage/maria/maria_pack.c b/storage/maria/maria_pack.c index 351a2014059..4480dabbcad 100644 --- a/storage/maria/maria_pack.c +++ b/storage/maria/maria_pack.c @@ -683,6 +683,8 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table) error|=my_close(new_file,MYF(MY_WME)); if (!result_table) { + (void) flush_pagecache_blocks(isam_file->s->pagecache, &isam_file->dfile, + FLUSH_RELEASE); error|=my_close(isam_file->dfile.file, MYF(MY_WME)); isam_file->dfile.file= -1; /* Tell maria_close file is closed */ isam_file->s->bitmap.file.file= -1; @@ -729,7 +731,7 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table) my_delete(new_name,MYF(MY_WME)); } else - error=my_redel(org_name,new_name,MYF(MY_WME | MY_COPYTIME)); + error=my_redel(org_name, new_name, 0, MYF(MY_WME | MY_COPYTIME)); } if (! error) error=save_state(isam_file,mrg,new_length,glob_crc); @@ -756,13 +758,13 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table) DBUG_RETURN(0); err: - end_pagecache(maria_pagecache, 1); free_counts_and_tree_and_queue(huff_trees,trees,huff_counts,fields); if (new_file >= 0) my_close(new_file,MYF(0)); if (join_maria_file >= 0) my_close(join_maria_file,MYF(0)); mrg_close(mrg); + end_pagecache(maria_pagecache, 1); fprintf(stderr, "Aborted: %s is not compressed\n", org_name); DBUG_RETURN(-1); } |