diff options
author | Michael Widenius <monty@askmonty.org> | 2011-08-12 15:51:05 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2011-08-12 15:51:05 +0300 |
commit | eeb04a339f2bf6eb64e87cf98869a03340bbd7c6 (patch) | |
tree | 41ec36557b46750c8ab326be3bd234e4459976f4 | |
parent | b5ef802f8e222dbff177a0c45705a57fd0766d01 (diff) | |
parent | 8b63d346a05b743686c68f036abba4e55bc18764 (diff) | |
download | mariadb-git-eeb04a339f2bf6eb64e87cf98869a03340bbd7c6.tar.gz |
Autmatic merge with 5.1
-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 86c721f75fa..ac3d23b7079 100644 --- a/storage/maria/ma_bitmap.c +++ b/storage/maria/ma_bitmap.c @@ -907,7 +907,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 a845ff50c64..1f683908642 100644 --- a/storage/maria/ma_check.c +++ b/storage/maria/ma_check.c @@ -1983,14 +1983,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; |