List:Commits« Previous MessageNext Message »
From:He Zhenxing Date:March 9 2009 8:40am
Subject:bzr commit into mysql-6.0-bugteam branch (zhenxing.he:3089) Bug#22082
View as plain text  
#At file:///media/sdb2/hezx/work/mysql/bzrwork/b22082/6.0-bugteam/

 3089 He Zhenxing	2009-03-09 [merge]
      Auto merge BUG#22082 from 5.1-bugteam to 6.0-bugteam
modified:
  include/my_sys.h
  mysys/errors.c
  mysys/my_fstream.c
  mysys/my_pread.c
  mysys/my_write.c

=== modified file 'include/my_sys.h'
--- a/include/my_sys.h	2009-02-16 21:18:45 +0000
+++ b/include/my_sys.h	2009-03-09 08:39:32 +0000
@@ -688,6 +688,7 @@ extern void     my_osmaperr(unsigned lon
 extern void TERMINATE(FILE *file, uint flag);
 #endif
 extern void init_glob_errs(void);
+extern void wait_for_free_space(const char *filename, int errors);
 extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags);
 extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags);
 extern int my_fclose(FILE *fd,myf MyFlags);

=== modified file 'mysys/errors.c'
--- a/mysys/errors.c	2008-10-20 09:16:47 +0000
+++ b/mysys/errors.c	2009-03-09 08:39:32 +0000
@@ -39,7 +39,7 @@ const char * NEAR globerrs[GLOBERRS]=
   "Can't change dir to '%s' (Errcode: %d)",
   "Warning: '%s' had %d links",
   "Warning: %d files and %d streams is left open\n",
-  "Disk is full writing '%s' (Errcode: %d). Waiting for someone to free space... Retry in %d secs",
+  "Disk is full writing '%s' (Errcode: %d). Waiting for someone to free space... (Expect up to %d secs delay for server to continue after freeing disk space)",
   "Can't create directory '%s' (Errcode: %d)",
   "Character set '%s' is not a compiled character set and is not specified in the '%s' file",
   "Out of resources when opening file '%s' (Errcode: %d)",
@@ -94,3 +94,17 @@ void init_glob_errs()
   EE(EE_CANT_CHMOD)    = "Can't change mode for file '%s' to 0x%lx (Error: %d)";
 }
 #endif
+
+void wait_for_free_space(const char *filename, int errors)
+{
+  if (errors == 0)
+    my_error(EE_DISK_FULL,MYF(ME_BELL | ME_NOREFRESH),
+             filename,my_errno,MY_WAIT_FOR_USER_TO_FIX_PANIC);
+  if (!(errors % MY_WAIT_GIVE_USER_A_MESSAGE))
+    my_printf_error(EE_DISK_FULL,
+                    "Retry in %d secs. Message reprinted in %d secs",
+                    MYF(ME_BELL | ME_NOREFRESH),
+                    MY_WAIT_FOR_USER_TO_FIX_PANIC,
+                    MY_WAIT_GIVE_USER_A_MESSAGE * MY_WAIT_FOR_USER_TO_FIX_PANIC );
+  (void) sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC);
+}

=== modified file 'mysys/my_fstream.c'
--- a/mysys/my_fstream.c	2008-06-17 23:37:23 +0000
+++ b/mysys/my_fstream.c	2009-03-09 08:39:32 +0000
@@ -131,10 +131,8 @@ size_t my_fwrite(FILE *stream, const uch
       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),
-                   "[stream]",my_errno,MY_WAIT_FOR_USER_TO_FIX_PANIC);
-        (void) sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC);
+        wait_for_free_space("[stream]", errors);
+        errors++;
         (void) my_fseek(stream,seekptr,MY_SEEK_SET,MYF(0));
         continue;
       }

=== modified file 'mysys/my_pread.c'
--- a/mysys/my_pread.c	2008-10-31 18:02:34 +0000
+++ b/mysys/my_pread.c	2009-03-09 08:39:32 +0000
@@ -180,10 +180,8 @@ size_t my_pwrite(File Filedes, const uch
     if ((my_errno == ENOSPC || my_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),
-                  my_filename(Filedes),my_errno,MY_WAIT_FOR_USER_TO_FIX_PANIC);
-      sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC);
+      wait_for_free_space(my_filename(Filedes), errors);
+      errors++;
       continue;
     }
     if ((writtenbytes && writtenbytes != (size_t) -1) || my_errno == EINTR)

=== modified file 'mysys/my_write.c'
--- a/mysys/my_write.c	2008-07-23 08:52:08 +0000
+++ b/mysys/my_write.c	2009-03-09 08:39:32 +0000
@@ -59,10 +59,8 @@ size_t my_write(File Filedes, const ucha
     if ((my_errno == ENOSPC || my_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),
-		 my_filename(Filedes),my_errno,MY_WAIT_FOR_USER_TO_FIX_PANIC);
-      (void) sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC);
+      wait_for_free_space(my_filename(Filedes), errors);
+      errors++;
       continue;
     }
 

Thread
bzr commit into mysql-6.0-bugteam branch (zhenxing.he:3089) Bug#22082He Zhenxing9 Mar