Commit 8b63d346 authored by Michael Widenius's avatar Michael Widenius

Fixed lp:814231 Aria post-recovery error "Bitmap at page 0 has pages reserved...

Fixed lp:814231 Aria post-recovery error "Bitmap at page 0 has pages reserved outside of data file length"
The bug was a wrong check in aria_chk;  The table was fine.


storage/maria/ma_bitmap.c:
  Print whole bitmap to find errors in last bitmap
storage/maria/ma_check.c:
  Fixed wrong test if bitmap was overallocated.
parent 47c23a11
......@@ -874,7 +874,7 @@ void _ma_print_bitmap(MARIA_FILE_BITMAP *bitmap, uchar *data,
fprintf(DBUG_FILE,"\nDump of bitmap page at %s\n", llstr(page, llbuff));
page++; /* Skip bitmap page */
for (pos= data, end= pos + bitmap->total_size;
for (pos= data, end= pos + bitmap->max_total_size;
pos < end ;
pos+= 6)
{
......
......@@ -1976,14 +1976,22 @@ static int check_block_record(HA_CHECK *param, MARIA_HA *info, int extend,
{
/* Not at end of bitmap */
uint bitmap_pattern;
uint byte_offset;
offset_page= (uint) ((page % share->bitmap.pages_covered) -1) * 3;
offset= offset_page & 7;
data= bitmap_buff + offset_page / 8;
byte_offset= offset_page / 8;
data= bitmap_buff + byte_offset;
bitmap_pattern= uint2korr(data);
if (byte_offset + 1 == share->bitmap.max_total_size)
{
/* On last byte of bitmap; Remove possible checksum */
bitmap_pattern&= 0xff;
}
if (((bitmap_pattern >> offset)) ||
(data + 2 < bitmap_buff + share->bitmap.max_total_size &&
_ma_check_if_zero(data+2, bitmap_buff + share->bitmap.max_total_size -
data - 2)))
(byte_offset + 2 < share->bitmap.max_total_size &&
_ma_check_if_zero(data+2, share->bitmap.max_total_size -
byte_offset - 2)))
{
ulonglong bitmap_page;
bitmap_page= page / share->bitmap.pages_covered;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment