1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

MDEV-4576 : Aria storage engine's temporary files might not be deleted (Errcode : 13)

See also MySQL Bug #39750  and similar ones.

Fix my_delete() on Windows, to safely remvoe files on Windows, including files  that are opened by another threads in the same process, antiviruses and  backup applications. If file to be deleted is  also  opened by another thread, the file is renamed to unique name prior to deletion - this makes it possible to create file with the same name right after deletion.
With this patch my_delete_allow_opened() becomes obsolete and is replaced with my_delete().

This patch is rework of the patch  http://lists.mysql.com/commits/59327  for MySQL bug#39750.
This commit is contained in:
Vladislav Vaintroub
2013-06-16 22:13:26 +02:00
parent 4b058643cd
commit c61c1d7ce1
6 changed files with 103 additions and 82 deletions

View File

@@ -3585,7 +3585,7 @@ void do_remove_file(struct st_command *command)
' ');
DBUG_PRINT("info", ("removing file: %s", ds_filename.str));
error= my_delete_allow_opened(ds_filename.str, MYF(disable_warnings ? 0 : MY_WME)) != 0;
error= my_delete(ds_filename.str, MYF(disable_warnings ? 0 : MY_WME)) != 0;
handle_command_error(command, error, my_errno);
dynstr_free(&ds_filename);
DBUG_VOID_RETURN;