Commit 5407f511 authored by Michael Widenius's avatar Michael Widenius

Fixes to aria

- Fixed error when writing a blob to the last page on the bitmap.
- Marked bitmap changed in once case that could cause two rows to use the same blob page.
parent 6a9ac86c
...@@ -1447,10 +1447,7 @@ static ulong allocate_full_pages(MARIA_FILE_BITMAP *bitmap, ...@@ -1447,10 +1447,7 @@ static ulong allocate_full_pages(MARIA_FILE_BITMAP *bitmap,
best_prefix_bits|= tmp; best_prefix_bits|= tmp;
int6store(best_data, best_prefix_bits); int6store(best_data, best_prefix_bits);
if (!(best_area_size-= best_prefix_area_size)) if (!(best_area_size-= best_prefix_area_size))
{ goto end;
DBUG_EXECUTE("bitmap", _ma_print_bitmap_changes(bitmap););
DBUG_RETURN(block->page_count);
}
best_data+= 6; best_data+= 6;
} }
best_area_size*= 3; /* Bits to set */ best_area_size*= 3; /* Bits to set */
...@@ -1468,6 +1465,7 @@ static ulong allocate_full_pages(MARIA_FILE_BITMAP *bitmap, ...@@ -1468,6 +1465,7 @@ static ulong allocate_full_pages(MARIA_FILE_BITMAP *bitmap,
bitmap->used_size= (uint) (best_data - bitmap->map); bitmap->used_size= (uint) (best_data - bitmap->map);
DBUG_ASSERT(bitmap->used_size <= bitmap->total_size); DBUG_ASSERT(bitmap->used_size <= bitmap->total_size);
} }
end:
bitmap->changed= 1; bitmap->changed= 1;
DBUG_EXECUTE("bitmap", _ma_print_bitmap_changes(bitmap);); DBUG_EXECUTE("bitmap", _ma_print_bitmap_changes(bitmap););
DBUG_RETURN(block->page_count); DBUG_RETURN(block->page_count);
...@@ -2290,7 +2288,7 @@ my_bool _ma_bitmap_set_full_page_bits(MARIA_HA *info, ...@@ -2290,7 +2288,7 @@ my_bool _ma_bitmap_set_full_page_bits(MARIA_HA *info,
bitmap_page= page - page % bitmap->pages_covered; bitmap_page= page - page % bitmap->pages_covered;
if (page == bitmap_page || if (page == bitmap_page ||
page + page_count >= bitmap_page + bitmap->pages_covered) page + page_count > bitmap_page + bitmap->pages_covered)
{ {
DBUG_ASSERT(0); /* Wrong in data */ DBUG_ASSERT(0); /* Wrong in data */
DBUG_RETURN(1); DBUG_RETURN(1);
......
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