Commit 5ec88a30 authored by marko's avatar marko

branches/zip:

Fix bugs found during testing.
parent dbfea3e9
...@@ -1101,7 +1101,8 @@ btr_root_raise_and_insert( ...@@ -1101,7 +1101,8 @@ btr_root_raise_and_insert(
btr_set_min_rec_mark(node_ptr_rec, NULL, mtr); btr_set_min_rec_mark(node_ptr_rec, NULL, mtr);
if (!UNIV_UNLIKELY(page_zip_compress(page_zip, root))) { if (UNIV_LIKELY_NULL(page_zip)
&& !UNIV_UNLIKELY(page_zip_compress(page_zip, root))) {
/* The root page should only contain the /* The root page should only contain the
node pointer to new_page at this point. node pointer to new_page at this point.
Thus, the data should fit. */ Thus, the data should fit. */
......
...@@ -1518,7 +1518,9 @@ btr_cur_update_in_place( ...@@ -1518,7 +1518,9 @@ btr_cur_update_in_place(
block = buf_block_align(rec); block = buf_block_align(rec);
page_zip = buf_block_get_page_zip(block); page_zip = buf_block_get_page_zip(block);
if (UNIV_UNLIKELY(!page_zip_alloc(page_zip, buf_block_get_frame(block), if (UNIV_LIKELY_NULL(page_zip)
&& UNIV_UNLIKELY(!page_zip_alloc(page_zip,
buf_block_get_frame(block),
4 + rec_offs_size(offsets)))) { 4 + rec_offs_size(offsets)))) {
return(DB_OVERFLOW); return(DB_OVERFLOW);
} }
......
...@@ -653,7 +653,12 @@ page_rec_set_next( ...@@ -653,7 +653,12 @@ page_rec_set_next(
ut_ad(!next || ut_align_down(rec, UNIV_PAGE_SIZE) ut_ad(!next || ut_align_down(rec, UNIV_PAGE_SIZE)
== ut_align_down(next, UNIV_PAGE_SIZE)); == ut_align_down(next, UNIV_PAGE_SIZE));
if (UNIV_LIKELY(next != NULL)) {
offs = ut_align_offset(next, UNIV_PAGE_SIZE); offs = ut_align_offset(next, UNIV_PAGE_SIZE);
} else {
offs = 0;
}
if (page_rec_is_comp(rec)) { if (page_rec_is_comp(rec)) {
rec_set_next_offs_new(rec, page_zip, offs); rec_set_next_offs_new(rec, page_zip, offs);
} else { } else {
......
...@@ -213,7 +213,7 @@ page_zip_write_trailer( ...@@ -213,7 +213,7 @@ page_zip_write_trailer(
ut_ad(pos > PAGE_DATA); ut_ad(pos > PAGE_DATA);
ut_ad(pos < UNIV_PAGE_SIZE ut_ad(pos < UNIV_PAGE_SIZE
- page_trailer_get_len(buf_block_align((byte*) str))); - page_trailer_get_len(buf_frame_align((byte*) str)));
memcpy(page_zip->data + page_zip->size - (UNIV_PAGE_SIZE - pos), memcpy(page_zip->data + page_zip->size - (UNIV_PAGE_SIZE - pos),
str, length); str, length);
......
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