List:Commits« Previous MessageNext Message »
From:Andrei Elkin Date:February 2 2009 5:00pm
Subject:bzr commit into mysql-6.0-bugteam branch (aelkin:3002) Bug#42150
View as plain text  
#At file:///home/andrei/MySQL/BZR/FIXES/6.0-bt-bug42150-gni_nt_share_delete/ based on revid:alfranio.correia@stripped

 3002 Andrei Elkin	2009-02-02
      Bug #42150 binlog_start_comment.test failed: Error writing file 'UNOPENED'
      
      The reason of the bug appeared to be overreacting on absense of a binlog 
      file although the file name is presented in in the master binlog index file.
      By convention, there should be only a warning printed and the rest of 
      `reset master' logics be completed.
      This did not happen on windows due to incorrect value of my_errno returned
      from nt_share_delete().
      
      Fixed with correcting my_errno assignment in nt_share_delete() to be ENOENT in 
      the event of no binlog file. Some minor refactoring has been made.
modified:
  mysys/my_delete.c

=== modified file 'mysys/my_delete.c'
--- a/mysys/my_delete.c	2008-07-23 08:52:08 +0000
+++ b/mysys/my_delete.c	2009-02-02 17:00:11 +0000
@@ -61,6 +61,7 @@ int nt_share_delete(const char *name, my
   DBUG_ENTER("nt_share_delete");
   DBUG_PRINT("my",("name %s MyFlags %d", name, MyFlags));
 
+  errno= 0;
   for (cnt= GetTickCount(); cnt; cnt--)
   {
     sprintf(buf, "%s.%08X.deleted", name, cnt);
@@ -78,15 +79,22 @@ int nt_share_delete(const char *name, my
                            name, buf, errno));
     break;
   }
-
-  if (DeleteFile(buf))
-    DBUG_RETURN(0);
-
-  my_errno= GetLastError();
+  
+  if (errno == ERROR_FILE_NOT_FOUND)
+  {
+       my_errno= ENOENT;    // name doesn't exist is tolerable
+  }
+  else
+  {
+       if (DeleteFile(buf))
+            DBUG_RETURN(0);
+  }
+  if ((my_errno= GetLastError()) == 0)
+       my_errno= ENOENT;  // buf doesn't exist is tolerable
+  
   if (MyFlags & (MY_FAE+MY_WME))
-    my_error(EE_DELETE, MYF(ME_BELL + ME_WAITTANG + (MyFlags & ME_NOINPUT)),
-	       name, my_errno);
-
+       my_error(EE_DELETE, MYF(ME_BELL + ME_WAITTANG + (MyFlags & ME_NOINPUT)),
+                name, my_errno);
   DBUG_RETURN(-1);
 }
 #endif

Thread
bzr commit into mysql-6.0-bugteam branch (aelkin:3002) Bug#42150Andrei Elkin2 Feb