Fix for BUG#7714 "if disk full, sometimes MyISAM doesn't wait for free space, corrupts table"
This happened only if my_write() couldn't write even one byte. I cannot easily add a .test for this, but I tested by hand before and after the change. mysys/my_write.c: Monty and I could not find a reason why a write should not wait for free disk space (if disk is full) because it could not write at least one byte; doing so certainly corrupts tables. my_pwrite() and my_fwrite() don't test for -1, so no problem.
This commit is contained in:
parent
10844e41da
commit
5b47aaed3a
@ -49,8 +49,7 @@ uint my_write(int Filedes, const byte *Buffer, uint Count, myf MyFlags)
|
|||||||
MyFlags&= ~ MY_WAIT_IF_FULL; /* End if aborted by user */
|
MyFlags&= ~ MY_WAIT_IF_FULL; /* End if aborted by user */
|
||||||
#endif
|
#endif
|
||||||
if ((my_errno == ENOSPC || my_errno == EDQUOT) &&
|
if ((my_errno == ENOSPC || my_errno == EDQUOT) &&
|
||||||
(MyFlags & MY_WAIT_IF_FULL) &&
|
(MyFlags & MY_WAIT_IF_FULL))
|
||||||
(uint) writenbytes != (uint) -1)
|
|
||||||
{
|
{
|
||||||
if (!(errors++ % MY_WAIT_GIVE_USER_A_MESSAGE))
|
if (!(errors++ % MY_WAIT_GIVE_USER_A_MESSAGE))
|
||||||
my_error(EE_DISK_FULL,MYF(ME_BELL | ME_NOREFRESH),
|
my_error(EE_DISK_FULL,MYF(ME_BELL | ME_NOREFRESH),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user