diff options
author | Michael Widenius <monty@askmonty.org> | 2011-08-12 15:40:56 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2011-08-12 15:40:56 +0300 |
commit | 8b63d346a05b743686c68f036abba4e55bc18764 (patch) | |
tree | 35c90fc21fabd9555a1258a05ff151862f803d35 | |
parent | 47c23a1128315a1530abc5cb361f41b6cdf3106c (diff) | |
download | mariadb-git-8b63d346a05b743686c68f036abba4e55bc18764.tar.gz |
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.
-rw-r--r-- | storage/maria/ma_bitmap.c | 2 | ||||
-rw-r--r-- | storage/maria/ma_check.c | 16 |
2 files changed, 13 insertions, 5 deletions
diff --git a/storage/maria/ma_bitmap.c b/storage/maria/ma_bitmap.c index bd24ddb35ea..9853743d574 100644 --- a/storage/maria/ma_bitmap.c +++ b/storage/maria/ma_bitmap.c @@ -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) { diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c index b2112719c5e..ee41723919f 100644 --- a/storage/maria/ma_check.c +++ b/storage/maria/ma_check.c @@ -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; |