From 0c8582b3c3691aedd72812721b6c6e83fc5256d8 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 14 Dec 2002 12:57:12 +0200 Subject: [PATCH] On windows, delete any conflicting 'to' files on rename(from,to) This fixes a bug with REPAIR TABLE t1 USE_FRM on windows. mysys/my_rename.c: On windows, delete any conflicting 'to' files on rename(from,to) --- mysys/my_rename.c | 7 +++++++ 1 file changed, 7 insertions(+) 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))