summaryrefslogtreecommitdiff
path: root/mysys/my_redel.c
diff options
context:
space:
mode:
authorunknown <svoj@mysql.com/april.(none)>2007-03-28 21:09:16 +0500
committerunknown <svoj@mysql.com/april.(none)>2007-03-28 21:09:16 +0500
commite8a25c95d3f8daf292b133b98f47d80167e915e7 (patch)
treea32b2a881a315a26570a3d1d30e4619b52ceb588 /mysys/my_redel.c
parentc4b440aaf0838342b05e2ee16079f10ce11ee5e3 (diff)
downloadmariadb-git-e8a25c95d3f8daf292b133b98f47d80167e915e7.tar.gz
BUG#25521 - optimize table, delete, show table status leads to table
losing it's .MYD When OPTIMIZE TABLE is completed it attempts to rename temporary file to original name. This step may fail on windows when a file is opened. As a result data file might be deleted and optimized copy of file (table_name.MYD) remains. This situation is handled properly by my_delete_allow_opened, so use it instead of my_delete when attempting to rename a file on windows. No suitable test case for this bug. mysys/my_redel.c: Attempting to delete an opened file and to immediately create a new one with the same name may result in my_redel failure on windows. It may fail because file is not deleted until it is closed. This situation is handled properly by my_delete_allow_opened, so use it instead of my_delete.
Diffstat (limited to 'mysys/my_redel.c')
-rw-r--r--mysys/my_redel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mysys/my_redel.c b/mysys/my_redel.c
index 1e3cfceb495..0aec395cf65 100644
--- a/mysys/my_redel.c
+++ b/mysys/my_redel.c
@@ -60,7 +60,7 @@ int my_redel(const char *org_name, const char *tmp_name, myf MyFlags)
MyFlags))
goto end;
}
- else if (my_delete(org_name,MyFlags))
+ else if (my_delete_allow_opened(org_name, MyFlags))
goto end;
if (my_rename(tmp_name,org_name,MyFlags))
goto end;