#At file:///G:/bzr/ts2/ based on revid:vvaintroub@stripped
3029 Vladislav Vaintroub 2009-02-19
Provide better error message when pread() hits the end of file
modified:
storage/falcon/IO.cpp
=== modified file 'storage/falcon/IO.cpp'
--- a/storage/falcon/IO.cpp 2009-01-27 20:44:30 +0000
+++ b/storage/falcon/IO.cpp 2009-02-19 14:54:14 +0000
@@ -289,8 +289,18 @@ void IO::readPage(Bdb * bdb)
if (length != pageSize)
{
declareFatalError();
- throw SQLError(IO_ERROR, "read error on page %d of \"%s\": %s (%d)",
+ if (length == -1)
+ {
+ throw SQLError(IO_ERROR, "read error on page %d of \"%s\": %s (%d)",
bdb->pageNumber, (const char*) fileName, strerror (errno), errno);
+ }
+ else
+ {
+ throw SQLError(IO_ERROR,
+ "pread on file %s from page %d (offset %lld) returned %d bytes"
+ " instead of %d (possible read behind EOF)",
+ (const char*) fileName, bdb->pageNumber, (int64)offset, length, pageSize);
+ }
}
++reads;
Attachment: [text/bzr-bundle] bzr/vvaintroub@mysql.com-20090219145414-vq5gyqk0f6gsrd8p.bundle