MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Vladislav Vaintroub Date:August 16 2008 2:04pm
Subject:bzr commit into mysql-6.0-wtf branch (vvaintroub:2669) Bug#38342
View as plain text  
#At file:///C:/bzr/wtf2/

 2669 Vladislav Vaintroub	2008-08-16
      Bug#38342 -backup_myisam1 test fails on Windows
      The problem is that  this test, uses file locking and myisam unlocks 
      the same file region twice. Unix my_lock implementation based on fcntl() 
      does not return error in this case, but Windows UnlockFile() returns 
      ERROR_NOT_LOCKED.
      
      Fixed by ignoring ERROR_NOT_LOCKED from UnlockFile(). This fix does 
      not make myisam  better, but at least the implementation of my_lock() 
      compatible to *nix.
modified:
  mysys/my_lock.c

=== modified file 'mysys/my_lock.c'
--- a/mysys/my_lock.c	2008-07-23 08:52:08 +0000
+++ b/mysys/my_lock.c	2008-08-16 14:04:29 +0000
@@ -51,8 +51,17 @@ static int win_lock(File fd, int locktyp
 
   if (locktype == F_UNLCK)
   {
-    if(UnlockFileEx(hFile, 0, liLength.LowPart, liLength.HighPart, &ov))
+    if (UnlockFileEx(hFile, 0, liLength.LowPart, liLength.HighPart, &ov))
       DBUG_RETURN(0);
+    /*
+      For compatibility with fcntl implementation, ignore error,
+      if region was not locked
+    */
+    if (GetLastError() == ERROR_NOT_LOCKED)
+    {
+      SetLastError(0);
+      DBUG_RETURN(0);
+    }
     goto error;
   }
   else if (locktype == F_RDLCK)

Thread
bzr commit into mysql-6.0-wtf branch (vvaintroub:2669) Bug#38342Vladislav Vaintroub16 Aug