summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authormonty@mashka.mysql.fi <>2002-12-14 12:57:12 +0200
committermonty@mashka.mysql.fi <>2002-12-14 12:57:12 +0200
commit70b97a980f5289785d724bdb11a9e717e8570974 (patch)
tree5c7d0e037b0b8c075ec672c83b31a85c067de2e3 /mysys
parent00e005cbdb9bc67eac4e4e09bbacf842a071d3c8 (diff)
downloadmariadb-git-70b97a980f5289785d724bdb11a9e717e8570974.tar.gz
On windows, delete any conflicting 'to' files on rename(from,to)
This fixes a bug with REPAIR TABLE t1 USE_FRM on windows.
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_rename.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/mysys/my_rename.c b/mysys/my_rename.c
index ea895ffcf76..1b7f434e792 100644
--- a/mysys/my_rename.c
+++ b/mysys/my_rename.c
@@ -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))