Move part of the code from lock_rec_print() in a separate function
buf_page_try_get() because the same functionality is needed in
INFORMATION SCHEMA code.
Approved by: Heikki
is inline and accesses lock_t members.
As advised by Marko rename lock_get_type() to lock_get_type_low() and
create a public non-inline function lock_get_type() which calls
lock_get_type_low().
Approved by: Marko
created in fast index creation.
dict_load_indexes(): Always complain if the first index is not clustered.
lock_table_enqueue_waiting(): Always complain about lock waits in
a dictionary operation.
row_merge_rename_tables(): Add an assertion that dict_sys->mutex is
being held.
row_undo_mod_del_unmark_sec_and_undo_update(): Make the test about
temporary indexes more readable.
row_create_table_for_mysql(): Do not retry creating a temporary table
in fast index creation. Orphaned temporary tables will have to be dropped
in crash recovery.
buf_page_get_gen(). This saves one mutex operation per block request.
buf_page_get_gen(), various macros and functions: Add parameter zip_size.
btr_node_ptr_get_child(): Add parameter index.
fil_space_get_latch(): Add optional output parameter zip_size.
fil_space_get_zip_size(): Return 0 for space id==0, because the
system tablespace is never compressed.
fsp_header_init(): Remove the parameter zip_size.
ibuf_free_excess_pages(): Remove the parameter zip_size.
trx_rseg_t, trx_undo_t: Add field zip_size.
xdes_lst_get_next(): Remove, unused.
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().
btr_cur_t: Move page_block to page_cur_t::block.
page_cur_get_block(), page_cur_get_page_zip(): New functions.
page_cur_position(): Add parameter block.
Remove many page_zip parameters, now that there is page_cur_get_page_zip().
Replace some page, page_zip parameters with block.
Add some const qualifiers to function parameters and remove casts.
PAGE_HEAP_NO_INFIMUM, PAGE_HEAP_NO_SUPREMUM, PAGE_HEAP_NO_USER_LOW:
New constants.
Replace some cursor code in low-level diagnostic functions with
direct management of rec, because buf_block_t::buf_fix_count may be 0
when the functions are called, and debug assertions would fail.
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.
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().
of clustered indexes. Previously, parts of the code assumed that these
columns would exist on all leaf pages. Simplify the update-in-place of
these columns.
Add inline function dict_index_is_clust() to replace all tests
index->type & DICT_CLUSTERED.
Remove the redo log entry types MLOG_ZIP_WRITE_TRX_ID and
MLOG_ZIP_WRITE_ROLL_PTR, because the modifications to these columns
are covered by logical logging.
Fuse page_zip_write_trx_id() and page_zip_write_roll_ptr() into
page_zip_write_trx_id_and_roll_ptr().
page_zip_dir_add_slot(), page_zip_available(): Add flag "is_clustered",
so that no space will be reserved for TRX_ID and ROLL_PTR on leaf pages
of secondary indexes.
page_zip_apply_log(): Flag an error when val==0 is encoded with two bytes.
page_zip_write_rec(): Add debug assertions that there is enough space
available for the entry before copying the data bytes of the record.
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.
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.