mirror of
https://github.com/MariaDB/server.git
synced 2026-05-07 15:45:33 +02:00
On windows, delete any conflicting 'to' files on rename(from,to)
This fixes a bug with REPAIR TABLE t1 USE_FRM on windows.
This commit is contained in:
parent
00e005cbdb
commit
70b97a980f
1 changed files with 7 additions and 0 deletions
|
|
@ -46,6 +46,13 @@ int my_rename(const char *from, const char *to, myf MyFlags)
|
|||
}
|
||||
#endif
|
||||
#if defined(HAVE_RENAME)
|
||||
#ifdef __WIN__
|
||||
/*
|
||||
On windows we can't rename over an existing file:
|
||||
Remove any conflicting files:
|
||||
*/
|
||||
(void) my_delete(to, MYF(0));
|
||||
#endif
|
||||
if (rename(from,to))
|
||||
#else
|
||||
if (link(from, to) || unlink(from))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue