MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Georgi Kodinov Date:September 12 2008 12:57pm
Subject:bzr commit into mysql-6.0 branch (kgeorge:2835) Bug#38342
View as plain text  
#At file:///home/kgeorge/mysql/bzr/merge-6.0-bugteam/

 2835 Georgi Kodinov	2008-09-12
       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 
       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.

per-file messages:
    Bug#38342 -backup_myisam1 test fails on Windows
=== modified file 'mysys/my_lock.c'
--- a/mysys/my_lock.c	2008-07-23 08:52:08 +0000
+++ b/mysys/my_lock.c	2008-09-12 12:57:19 +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))
+    /*
+      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)

bzr commit into mysql-6.0 branch (kgeorge:2835) Bug#38342Georgi Kodinov12 Sep