page_cur_set_before_first(), page_cur_set_after_last(),
page_cur_position(): Add const qualifiers to buf_block_t and rec.
A better solution would be to define a const_page_cur_t and a
set of accessors, but it would lead to severe code duplication.
page_rec_get_n_recs_before(): Add const qualifiers.
page_dir_get_nth_slot(): Define as a const-preserving macro.
page_dir_slot_get_rec(), page_dir_slot_get_n_owned(),
page_dir_find_owner_slot(), page_check_dir(): Add const qualifiers.
page_rec_get_next_low(): Add const qualifiers.
page_rec_get_next_const(), page_rec_get_prev_const(): New functions,
based on the const-less page_rec_get_next() and page_rec_get_prev().
page_cur_get_page(), page_cur_get_block(), page_cur_get_page_zip(),
page_cur_get_rec(): Define as const-preserving macros.
page_cur_try_search_shortcut(), page_cur_search_with_match():
Add const qualifiers.
buf_page_get_mutex(): Add a const qualifier to buf_page_t*.
rec_get_next_ptr_const(): Const variant of rec_get_next_ptr().
For some reason, GCC 4.2.1 ignores casts (for removing constness)
in calls to inline functions.
page_align(), ut_align_down(): Make the parameter const void*, but still
return a non-const pointer. This is ugly, but these functions cannot be
replaced with a const-preserving macro in a portable way, given that
the pointer argument is not always pointing to bytes.
buf_block_get_page_zip(): Implement as a const-preserving macro.
buf_frame_get_page_zip(), buf_block_align(): Add const qualifiers.
lock_rec_get_prev(): Silence GCC 4.2.1 warnings.
mlog_write_initial_log_record(), mlog_write_initial_log_record_fast(),
mtr_memo_contains(): Add const qualifier to the pointer.
page_header_get_ptr(): Rewrite as page_header_get_offs(), and
implement as a macro that calls this function.
from the adaptive hash index [btr_search_guess_on_hash() and
btr_search_validate()]. Some references to buf_block_align() remain
in debug builds.
btr_store_big_rec_extern_fields(): Add the parameter rec_block.
page_rec_get_next_low(): Do not assume that the page has been
allocated from the buffer pool when printing the diagnostic information.
page_cur_insert_rec_low(): Replace the parameter page_zip_des_t* page_zip
with the parameter buf_block_t* block.
Replace all page_t* parameters with buf_block_t*, and replace many
rec_t* parameters with heap_no. This eliminates also many
rec_get_heap_no() calls, which became more expensive with the
introduction of ROW_FORMAT=COMPACT in MySQL/InnoDB 5.0.3.
page_rec_get_heap_no(), lock_get_min_heap_no(): New functions.
page_set_max_trx_id(): Replace page_t* parameter with buf_block_t*,
to avoid a buf_block_align() call.
Replace some occurrences of page_get_page_no() with buf_block_get_page_no().
page_cur_delete_rec(): Replace buf_block_align() with page_cur_get_block().
with page_get_page_no() and page_get_space_id(). We want to avoid
buf_block_align() calls, and the page_no and space_id are now stamped
on the pages early on.
ut_malloc() to avoid breaking the latching order.
page_rec_check(), page_dir_slot_get_rec(): Replace buf_frame_align()
with ut_align_down() to avoid assertion failures in page_zip_validate().
on B-tree index pages.
page_rec_set_next(): Assert that rec != next.
rec_get_next_ptr(), rec_get_next_offs(): On compact pages, assert that
there are at least REC_N_NEW_EXTRA_BYTES + 1 between records.
page_cur_insert_rec_write_log(): Replace a buf_frame_align() call
with ut_align_offset().
page_cur_insert_rec_low(): Assert that current_rec != insert_rec.
btr_cur_compress_if_useful(): Replace if () return(); return() with return.
page_rec_get_next_low(): New function.
page_rec_get_prev(): Invoke page_is_comp() outside the loop.
Replace page_rec_get_next() with loop-specific instances of
page_rec_get_next_low().
page_copy_rec_list_end(): Add some debug assertions.
buf_page_print(): Print also compressed pages. Add parameter zip_size.
buf_flush_init_for_writing(): Stamp the fields on a compressed B-tree index
page.
Add the header field FIL_PAGE_ZBLOB_SPACE_ID as an alias of FIL_PAGE_PREV.
page_zip_calc_checksum(): New function.
page_zip_compress(): Avoid copying the fields that are written in
buf_flush_init_for_writing().
page_zip_header_cmp(): New function for comparing those fields of the
page header that will not be written in buf_flush_init_for_writing().
operations on BLOB columns. There are some bugs in the code, because
test-insert and a few other tests fail.
page_mem_free(): Add parameter index. Decrement PAGE_N_RECS here.
Move some operations to page_zip_dir_delete().
page_zip_clear_rec(): Make this a static function.
page_zip_dir_delete(): Add parameters index and offsets.
Decrement PAGE_N_RECS and clear info_bits and n_owned.
page_zip_get_n_prev_extern(): Correct the synopsis and the algorithm.
Add parameter page_zip. Search the records in heap_no order instead
of collation order.
page_zip_compress(), page_zip_decompress(): Only copy BLOB pointers
and increment n_blobs for records that have not been deleted.
page_zip_clear_rec(): Clear trx_id and roll_ptr on the compressed page.
page_zip_dir_delete(): Decrement PAGE_N_RECS. Shift the array of
BLOB pointers. Call page_zip_clear_rec().
page_zip_dir_add_slot(): Shift the array of BLOB pointers to make
space of roll_ptr and trx_id.
page_cur_delete_rec(): Do not decrement PAGE_N_RECS or call
page_zip_clear_rec(), as page_mem_free() already does it.
btr_compress(): Pass the correct page_zip to btr_node_ptr_set_child_page_no().
page_mem_free(): Remove parameter mtr. Do not call page_zip_clear_rec() here.
page_cur_delete_rec(): Call page_zip_clear_rec() here. Decrement PAGE_N_RECS
only after calling page_mem_free(). Assert page_zip_validate().
row_upd_rec_in_place(), page_zip_write_rec(): Add parameter "index".
page_dir_set_n_heap(): Add a debug assertion that on compressed
pages, n_heap will always be incremented by one. Improve code formatting.
page_zip_dir_add_slot(): New function, called from
page_cur_insert_rec_low() after page_mem_alloc_heap().
rec_set_n_owned_new(): Do not call page_zip_rec_set_owned()
on the supremum record.
rec_offs_make_valid(): Add debug assertions.
page_zip_dir_user_size(): Correct an off-by-one error in the debug assertion.
page_zip_apply_log(): Add parameter trx_id_col. Skip trx_id and roll_ptr.
page_zip_decompress(): Simplify the handling of "storage" in the loop that
copies the uncompressed fields.
page_zip_write_rec(): Store trx_id and roll_ptr separately.
page_zip_write_trx_id(), page_zip_write_roll_ptr(): Fix off-by-one errors.
page_cur_insert_rec_low(): Call page_zip_dir_add_slot() after
page_mem_alloc_heap(). Remove some redundant assertions.
Pass page_zip to page_dir_split_slot().
do not allow extra_size to decrease on compressed pages.
Split page_mem_alloc() to page_mem_alloc_free() and page_mem_alloc_heap().
page_cur_insert_rec_low(): Remove parameter "tuple". Implement some of the
logic from page_mem_alloc().
page_cur_tuple_insert(): Convert the tuple to a record and calculate offsets.
page_zip_validate(): Assert that the page is in compact format.
compressed pages.
btr_root_raise_and_insert(): Distinguish root_page_zip and new_page_zip.
btr_cur_set_ownership_of_extern_field(): Do not log the write on the
uncompressed page if it will be logged for page_zip.
lock_rec_insert_check_and_lock(), lock_sec_rec_modify_check_and_lock():
Update the max_trx_id field also on the compressed page.
mlog_write_ulint(): Add UNIV_UNLIKELY hints. Remove trailing white space.
mlog_log_string(): Remove trailing white space.
rec_set_field_extern_bits(): Remove parameter mtr, as the write will either
occur in the heap, or it will be logged at a higher level.
recv_parse_or_apply_log_rec_body(),
page_zip_write_header(): Add log record type MLOG_ZIP_WRITE_HEADER.
page_header_set_field(): Pass mtr=NULL to page_zip_write_header().
page_header_reset_last_insert(): Pass mtr to page_zip_write_header().
btr_page_set_index_id(), btr_page_set_level(),
btr_page_set_next(), btr_page_set_prev(): Pass mtr to page_zip_write_header().
row_upd_rec_sys_fields(): Pass mtr=NULL to page_zip_write_trx_id() and
page_zip_write_roll_ptr(), since the write will be logged at a higher level.
page_zip_write_header(): Add parameter mtr.
page_zip_write_header_log(): New function.
Remove rec_set_nth_field_extern_bit().
Make rec_set_nth_field_extern_bit_old() static.
Rename rec_set_nth_field_extern_bit_new()
to rec_set_field_extern_bits_new() and make it static.
row_ins_index_entry_low(): Remove bogus TODO comment.
BLOB pointers, trx_id, and roll_ptr.
btr_empty(), btr_create(), page_create(): Add parameter "index", as some
index information will be encoded on the compressed page.
Define REC_NODE_PTR_SIZE as 4.
Allow btr_page_reorganize() and btr_page_reorganize_low() to fail.
Define the error code DB_ZIP_OVERFLOW.
Make row_ins_index_entry_low() static.
page0zip: Encode the index, log reorganized records, and store uncompressed
fields separately from the compressed data stream.
decompresses properly.
page_mem_free(): Adjust the temporary condition for zeroing data.
page_zip_compress(): Do not accept Z_STREAM_END from non-final deflate().
Tighten the assertion on c_stream.avail_in.
page_zip_dir_sort(): Note that the high bound is not inclusive.
page_zip_dir_decode(): Remove off-by-one error in page_zip_dir_sort() call.
page_zip_set_extra_bytes(): Add the termination condition that was forgotten
from the second for loop. Simplify the code a little.
page_zip_decompress(): Do not accept Z_STREAM_END from non-final inflate().
Tighten the assertion on d_stream.avail_out. Increment heap_status correctly.
page_dir_set_n_slots(): Add debug assertion that there will be enough space
available in the modification log of the compressed page.
page_trailer_get_len(): Simplify the formula. Make more use of the function.
page_set_max_trx_id(), page_update_max_trx_id(): Add parameter page_zip.
Check that page_zip_decompress() is never called after modifying the
header or trailer of the compressed page, i.e., that page_zip_decompress()
will restore the uncompressed page as it was before the failed operation.
page_header_reset_last_insert(): Add page_zip parameter.
rec_get_next_ptr(): Return a pointer to the same page, or NULL.
page_dir_delete_slot(): Fix off-by-one errors.
Add page_zip parameter to page_dir_slot_set_rec().
Improve the documentation of the page_zip parameters in page0page.
Add function page_trailer_get_len().