List:Commits« Previous MessageNext Message »
From:Vladislav Vaintroub Date:September 12 2008 4:57pm
Subject:bzr commit into mysql-6.0-falcon branch (vvaintroub:2819) Bug#39321
View as plain text  
#At file:///G:/bzr/mysql-6.0-falcon-team/

 2819 Vladislav Vaintroub	2008-09-12
      Bug#39321 - messages in recovery about exceptions from ReadFile.
      Ignore ERROR_HANDLE_EOF coming from ReadFile() It is end of file 
      and read should just return 0 like it does in Posix case.
modified:
  storage/falcon/SerialLogFile.cpp

=== modified file 'storage/falcon/SerialLogFile.cpp'
--- a/storage/falcon/SerialLogFile.cpp	2008-09-05 22:36:19 +0000
+++ b/storage/falcon/SerialLogFile.cpp	2008-09-12 16:56:45 +0000
@@ -263,15 +263,23 @@ uint32 SerialLogFile::read(int64 positio
 	overlapped.Offset = pos.LowPart;
 	overlapped.OffsetHigh = pos.HighPart;
 
-	DWORD ret;
+	DWORD n;
 
-	if (!ReadFile(handle, data, effectiveLength, &ret, &overlapped))
-		throw SQLError(IO_ERROR, "serial log ReadFile failed with %d", GetLastError());
+	if (!ReadFile(handle, data, effectiveLength, &n, &overlapped))
+		{
+		DWORD lastError = GetLastError();
+		if(lastError != ERROR_HANDLE_EOF)
+			throw SQLError(IO_ERROR, "serial log ReadFile failed with %d", 
+							GetLastError());
+		else
+			n = 0;	// reached end of file
+		}
 
-	offset = position + effectiveLength;
+
+	offset = position + n;
 	highWater = MAX(offset, highWater);
 	
-	return ret;
+	return n;
 #else
 
 #if defined(HAVE_PREAD) && !defined(HAVE_BROKEN_PREAD)

Thread
bzr commit into mysql-6.0-falcon branch (vvaintroub:2819) Bug#39321Vladislav Vaintroub12 Sep