From c868213373782dc172a6d279d4d3d8ef45cdbc57 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 24 Sep 2004 11:54:37 +0200 Subject: Fix for BUG#3248 "Doc says MyISAM warns if disk full but it does not": we force the message to the error log, and we make it more informative; we treat EDQUOT like ENOSPC. mysys/errors.c: more informative message mysys/my_fstream.c: Treat EDQUOT like ENOSPC. mysys/my_pread.c: Treat EDQUOT like ENOSPC. mysys/my_write.c: Treat EDQUOT like ENOSPC. mysys/mysys_priv.h: Define EDQUOT when it does not exist. Finally decided to put it here after discussion with Monty: as this constant is used only in 3 files only in mysys/, I don't make it visible everywhere (there currently is no file of choice for such defines; my_base.h does not contain any). Using a value which never happens avoids collisions. sql/mysqld.cc: If ME_NOREFRESH, we write message to error log, even if it has been saved for client (because if operation is hanging, the message does not get to client now; example is MyISAM waiting for free disk space). --- mysys/my_fstream.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'mysys/my_fstream.c') diff --git a/mysys/my_fstream.c b/mysys/my_fstream.c index 94f3aaf3464..0ad789e98ac 100644 --- a/mysys/my_fstream.c +++ b/mysys/my_fstream.c @@ -114,13 +114,15 @@ uint my_fwrite(FILE *stream, const byte *Buffer, uint Count, myf MyFlags) if (my_thread_var->abort) MyFlags&= ~ MY_WAIT_IF_FULL; /* End if aborted by user */ #endif - if (errno == ENOSPC && (MyFlags & MY_WAIT_IF_FULL)) + if ((errno == ENOSPC || errno == EDQUOT) && + (MyFlags & MY_WAIT_IF_FULL)) { - if (!(errors++ % MY_WAIT_GIVE_USER_A_MESSAGE)) - my_error(EE_DISK_FULL,MYF(ME_BELL | ME_NOREFRESH)); - sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC); - VOID(my_fseek(stream,seekptr,MY_SEEK_SET,MYF(0))); - continue; + if (!(errors++ % MY_WAIT_GIVE_USER_A_MESSAGE)) + my_error(EE_DISK_FULL,MYF(ME_BELL | ME_NOREFRESH), + "[stream]",my_errno,MY_WAIT_FOR_USER_TO_FIX_PANIC); + VOID(sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC)); + VOID(my_fseek(stream,seekptr,MY_SEEK_SET,MYF(0))); + continue; } #endif if (ferror(stream) || (MyFlags & (MY_NABP | MY_FNABP))) -- cgit v1.2.1