#At file:///home/os136802/mysql/develop/repo/falcon-bug45297/ based on revid:bjorn.munch@stripped
2727 Olav Sandstaa 2009-06-12
In Bug#44744 and Bug#45297 a crash occures during recovery. In both
these cases the crash occurs when a record in a data page is attempted
updated and the record is not already present in the page. This patch
does not solve this problem but will make the recovery fail when the
invalid update to the data page occurs instead of failing later when
the invalid data is used.
Common for both recovery crashes is that DataPage::updateRecord() is
called with a lineNumber that is equal to the page's maxLine. This is
not a correct use of this function as DataPage::updateRecord should
only be called for already existing records (ie. lineNumber should be
less than maxLine).
Through repeatedly running recovery I see several cases where this
happens but does not lead to a crash but instead likely leads to an
inconsistency. To avoid this inconsistency and to make the recovery
fail immediately instead of when the invalid data is used this patch
adds an ASSERT that verify that the lineNumber is valid.
modified:
storage/falcon/DataPage.cpp
=== modified file 'storage/falcon/DataPage.cpp'
--- a/storage/falcon/DataPage.cpp 2009-04-21 10:43:08 +0000
+++ b/storage/falcon/DataPage.cpp 2009-06-12 13:34:24 +0000
@@ -43,6 +43,8 @@ static const char THIS_FILE[]=__FILE__;
int DataPage::updateRecord(Section *section, int lineNumber, Stream *stream, TransId transId, bool earlyWrite)
{
+ ASSERT(lineNumber < maxLine);
+
Dbb *dbb = section->dbb;
LineIndex *index = lineIndex + lineNumber;
int length = stream->totalLength;
Attachment: [text/bzr-bundle] bzr/olav@sun.com-20090612133424-o168pezk2hbk70qe.bundle