diff options
-rw-r--r-- | mysys/my_copy.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mysys/my_copy.c b/mysys/my_copy.c index 80a68f61b12..3f8b0695a25 100644 --- a/mysys/my_copy.c +++ b/mysys/my_copy.c @@ -110,6 +110,11 @@ int my_copy(const char *from, const char *to, myf MyFlags) err: if (from_file >= 0) VOID(my_close(from_file,MyFlags)); - if (to_file >= 0) VOID(my_close(to_file,MyFlags)); + if (to_file >= 0) + { + VOID(my_close(to_file, MyFlags)); + /* attempt to delete the to-file we've partially written */ + VOID(my_delete(to, MyFlags)); + } DBUG_RETURN(-1); } /* my_copy */ |