diff options
author | unknown <dkatz@damien-katzs-computer.local> | 2007-04-19 13:41:12 -0400 |
---|---|---|
committer | unknown <dkatz@damien-katzs-computer.local> | 2007-04-19 13:41:12 -0400 |
commit | 32da38eb4ead3154303b43312c024b0e107b4ec2 (patch) | |
tree | 32d3f2e7f59c6aad331f0551ad95e4cdca68a0c4 /mysys/my_copy.c | |
parent | ff2e7f450b00bf8814833f754fb624c3e239524f (diff) | |
download | mariadb-git-32da38eb4ead3154303b43312c024b0e107b4ec2.tar.gz |
Bug #25761 Table is partially created when disk is full, causing database corruption
mysys/my_copy.c:
my_copy now deletes any partially copied file if the copy fails to complete.
Diffstat (limited to 'mysys/my_copy.c')
-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 6143700befc..ec642b4083c 100644 --- a/mysys/my_copy.c +++ b/mysys/my_copy.c @@ -111,6 +111,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 */ |