for more accurate Valgrind debugging.
univ.i: Introduce UNIV_DEBUG_VALGRIND, UNIV_MEM_VALID, and UNIV_MEM_INVALID.
buf_LRU_block_free_non_file_page(): Invalidate the buffer frame
with UNIV_MEM_INVALID().
buf_LRU_get_free_block(): Declare the buffer frame valid
with UNIV_MEM_VALID().
Other memory is allocated and deallocated via malloc() and free(),
which are already overridden by Valgrind. Without the added
instrumentation, accesses to free pages in the buffer pool cannot
be caught.
The diagnostics could probably be improved further by declaring all
non-latched buffer frames invalid.
rec_convert_dtuple_to_rec_old(): Initialize the record in order to avoid
bogus Valgrind warnings about the ut_ad() in mach_write_to_1() and
mach_write_to_2().
page_zip_compress(), page_zip_write_rec(), page_zip_write_blob_ptr():
Replace ut_ad(page_validate(...)) with ut_ad(page_simple_validate_new(...)),
because otherwise crash recovery would fail.
on the ZIP_DUMMY index. Because it does not contain valid collation
information, the ordering check in page_validate() may fail on pages
containing non-binary data.
Instead, let the callers of page_zip_decompress() invoke page_validate()
when the index information is available.
of externally stored columns to 108 bytes when possible.
This will unmask a bug in the handling of BLOBs on compressed tablespaces,
especially of small page sizes. Apparently, the locally stored part must
be less than 235 bytes in size for the bug to occur.
dict_col_struct: Add field min_prefix.
dict_index_build_internal_non_clust(): Adjust min_prefix.
of non-clustered indexes. On these pages, only the bytes rec[-5..-1]
will be omitted from the compressed data stream. Save time by not looking
for trx_id or externally stored columns.
externally stored columns. Make some use of the fact in compression and
decompression.
rec_init_offsets(): Add ut_ad(dict_index_is_clust(index)) before flagging
external columns.
page_zip_get_trailer_len(): Assert ut_ad(!page_zip->n_blobs) unless
dict_index_is_clust(index).
page_zip_get_n_prev_extern(): Add ut_ad(dict_index_is_clust(index)).
page_zip_compress(), page_zip_decompress_low(): Add dict_index_is_clust()
assertions. Allow completely external storage of columns. Simplify
the computation of "externs".
page_zip_write_rec(): Store leaf node records of non-clustered indexes
with one memcpy(), avoiding rec_offs_n_extern() and the for loop.
page_zip_write_blob_ptr(): Add ut_ad(dict_index_is_clust(index)).
Simplify the computation of "externs".
page_zip_clear_rec(): Only attempt to zero out BLOB pointers when
the record belongs to a leaf page of a clustered index.
page_zip_dir_delete(): Take a fast path when the record is
not on a leaf page of a clustered index.
Simplify the computation of "externs".
page_zip_copy(): Assert that n_blobs is zero on anything else than
leaf pages of clustered indexes.
with page_zip_dir_insert(). Pass page_zip to rec_set_n_owned_new()
and page_dir_slot_set_n_owned().
page_zip_dir_insert(): New function. Shift the dense page directory and
write the inserted record there.
data0data.c: Add #include "page0zip.h" that was forgotten from r739.
page_cur_insert_rec_low(): Remove a memory leak when preventing
extra_size to grow.
record will fit or need external storage.
btr_page_get_sure_split_rec(): Estimate the free space of an empty
compressed page.
page_zip_rec_needs_ext(): New function, to replace existing tests whether
external storage is needed.
initial decompression, in case the record will be deleted and the
space will be reused by a smaller record.
page_zip_clear_rec_disable: Note the possibility of a page_zip_validate()
failure when the space of a deleted record is reused by a smaller record.
buf_LRU_get_free_block(): When zip_size changes, initialize all fields
of page_zip. This avoids an assertion failure in page_create_zip() when
a block with an originally larger zip_size is reallocated.
fsp_get_space_header(): Assert that the stored space id matches.
xdes_get_state(): Assert that the state is valid.
row_upd_sec_index_entry(): Remove redundant goto. Replace duplicated
cleanup code with goto func_exit.
mtr_memo_slot_release(): Eliminate the #else branch of #ifdef UNIV_DEBUG
by reorganizing the code.
stored columns.
page_zip_decompress(): We indeed need to clear the BLOB pointers of deleted
records twice. This implies that we also need to invoke rec_get_offsets()
twice for each record on a leaf page. Add clarifying comments.
page_zip_clear_rec(): Add the flag page_zip_clear_rec_disable for
disabling the clearing of deleted records.
page_zip_compress_write_log(): Do not invoke page_zip_validate(), since
this is a static function and the callers already invoke page_zip_validate().
page_zip_decompress_low(): Clear the page #ifdef UNIV_ZIP_DEBUG.
Optimizations: Remove local variable "last". Do not clear the BLOB
pointer until the modification log has been applied. (Since r690,
it will be cleared after applying the modification log.)
Avoid calling rec_get_offsets() a second time if there are no
uncompressed columns to be restored.
dict_load_table(): Initialize table->flags with zip_size.
mlog_parse_nbytes(), mlog_parse_string(): Add parameter page_zip and
write the changes also to the compressed page if one is specified.
Assert that these functions are not called on FIL_PAGE_INDEX pages.
buf_page_io_complete(): Replace block->frame with frame where appropriate.
recv_parse_or_apply_log_rec_body(): Add ut_a(!page_zip) where appropriate.
page_parse_delete_rec_list(): Add parameter page_zip.