mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
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.
This commit is contained in:
parent
ff2e7f450b
commit
32da38eb4e
1 changed files with 6 additions and 1 deletions
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue