Commit 8d2c12a9 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-3824 - xtradb file rename fails on Windows, if new name already exists.

Changed implementation os_file_rename() on Windows  such as it does not fail if destination file already exists. Now MoveFileEx() with MOVEFILE_REPLACE_EXISTING flag is used, instead of prior MoveFile().
This fixed implementation is better compatible with rename() on POSIX systems.
parent 974abc7a
......@@ -1870,7 +1870,7 @@ os_file_rename_func(
#ifdef __WIN__
BOOL ret;
ret = MoveFile((LPCTSTR)oldpath, (LPCTSTR)newpath);
ret = MoveFileEx((LPCTSTR)oldpath, (LPCTSTR)newpath, MOVEFILE_REPLACE_EXISTING);
if (ret) {
return(TRUE);
......
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