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.
parent e5f50abc
...@@ -60,7 +60,7 @@ int my_redel(const char *org_name, const char *tmp_name, myf MyFlags) ...@@ -60,7 +60,7 @@ int my_redel(const char *org_name, const char *tmp_name, myf MyFlags)
MyFlags)) MyFlags))
goto end; goto end;
} }
else if (my_delete(org_name,MyFlags)) else if (my_delete_allow_opened(org_name, MyFlags))
goto end; goto end;
if (my_rename(tmp_name,org_name,MyFlags)) if (my_rename(tmp_name,org_name,MyFlags))
goto end; goto end;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment