accessors returning pointers with macros that preserve const qualifiers.
In UNIV_DEBUG builds, retain the accessors and cast away constness there.
dfield_get_type(), dfield_get_data(), dtuple_get_nth_field(),
dict_table_get_nth_col(), dict_table_get_sys_col(): Implement as macro
unless #ifdef UNIV_DEBUG.
rec_get_nth_field(): Replace with rec_get_nth_field_offs() that does not
do pointer arithmetics. Implement rec_get_nth_field() as a macro.
and modify some functions to return const pointers. Add const qualifiers
to local variable declarations or casts to remove the const qualifier
in those places where write access is needed.
of externally stored columns, and fix bugs introduced in r873. (Bug #22496)
btr_page_get_sure_split_rec(), btr_page_insert_fits(),
rec_get_converted_size(), rec_convert_dtuple_to_rec(),
rec_convert_dtuple_to_rec_old(), rec_convert_dtuple_to_rec_new():
Add parameters ext and n_ext. Flag external fields during the
conversion.
rec_set_field_extern_bits(), rec_set_field_extern_bits_new(),
rec_offs_set_nth_extern(), rec_set_nth_field_extern_bit_old():
Remove. The bits are set by rec_convert_dtuple_to_rec().
page_cur_insert_rec_low(): Remove the parameters ext and n_ext.
btr_cur_add_ext(): New utility function for updating and sorting ext[].
Low-level functions now expect the array to be in ascending order
for performance reasons. Used in btr_cur_optimistic_insert(),
btr_cur_pessimistic_insert(), and btr_cur_pessimistic_update().
btr_cur_optimistic_insert(): Remove some defensive code, because we cannot
compute the added parameters of rec_get_converted_size().
btr_push_update_extern_fields(): Sort the array. Require the array to
be twice the maximum usage, so that ut_ulint_sort() can be used.
dtuple_convert_big_rec(): Allocate new space for the BLOB pointer,
to avoid overwriting prefix indexes to the same column. Adapt
dtuple_convert_back_big_rec().
row_build_index_entry(): Fetch the columns also for prefix indexes of
the clustered index.
page_zip_apply_log(), page_zip_decompress_clust(): Allow externally
stored fields to lack a locally stored part.
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.
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.
trx-undo_prev_version_build(): Pass offsets==NULL to
rec_set_field_extern_bits().
rec_set_field_extern_bits(), rec_set_field_extern_bits_new():
Accept offsets==NULL.
row_upd_rec_in_place(): Remove the bogus comment that the function
would only be invoked on a clustered index. Remove the related
debug assertion.
page_zip_dir_delete() will need to handle BLOBs.
rec_set_field_extern_bits(), rec_set_field_extern_bits_new():
Add parameter offsets.
rec_offs_set_nth_extern(): New function to set an extern bit in offsets.
This will be called when an extern bit is set in a record.
page_cur_rec_insert(), page_cur_insert_rec_low(): Document that the
parameter "offsets" is in/out.
page_zip_dir_delete(): Note that the array of BLOB pointers will need
to be shifted.
page0zip.ic: Document the entry type for clearing a record.
page_zip_available(): Add parameter "index". Remove parameters
"is_leaf" and "is_clustered".
page_zip_get_trailer_len(): New function for computing the trailer length
of the compressed page.
page_zip_apply_log(): Implement the modification log entry type for
clearing the data bytes of a record.
page_zip_decompress(): Initialize n_blobs when actually copying the
BLOB pointers to place.
page_zip_validate(): Add diagnostic messages for failures. Check
also m_start, m_end, and n_blobs.
page_zip_write_blob_ptr(): Add page_zip_validate() assertion.
rec_get_offsets_reverse(): Calculate extra_size correctly.
page_zip_apply_log(): Fix an off-by-one error in comparison.
Replace heap_status with hs where possible.
Increment the heap_no in heap_status correctly.
page_zip_decompress(): Eliminate the local variable "err".
Check for Z_STREAM_END only at the start of a record, so that
incomplete records will always be detected.
page_zip_write_rec(): Calculate the address of "storage" in the
same way as elsewhere. Add TODO comments regarding the handling
of the uncompressed fields (BLOB pointers, trx_id, and roll_ptr).
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.