summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authordkatz@damien-katzs-computer.local <>2007-04-19 13:41:12 -0400
committerdkatz@damien-katzs-computer.local <>2007-04-19 13:41:12 -0400
commitcbcb418f76e10dca2dc0c009b82516585c1e790d (patch)
tree32d3f2e7f59c6aad331f0551ad95e4cdca68a0c4 /mysys
parent587cc24f7142bb641b60f2bcde17e0bc7c1597c3 (diff)
downloadmariadb-git-cbcb418f76e10dca2dc0c009b82516585c1e790d.tar.gz
Bug #25761 Table is partially created when disk is full, causing database corruption
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_copy.c7
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 */