From c61c1d7ce1c844b3912a279b642498f00649ebe7 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Sun, 16 Jun 2013 22:13:26 +0200 Subject: 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. --- mysys/my_redel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysys/my_redel.c') diff --git a/mysys/my_redel.c b/mysys/my_redel.c index d096a5c071c..b285bb25e2e 100644 --- a/mysys/my_redel.c +++ b/mysys/my_redel.c @@ -58,7 +58,7 @@ int my_redel(const char *org_name, const char *tmp_name, if (my_rename(org_name, name_buff, MyFlags)) goto end; } - else if (my_delete_allow_opened(org_name, MyFlags)) + else if (my_delete(org_name, MyFlags)) goto end; if (my_rename(tmp_name,org_name,MyFlags)) goto end; -- cgit v1.2.1