enum trx_dict_op: dictionary operation modes
trx_get_dict_operation(), trx_set_dict_operation(): Accessors for
trx->dict_operation.
lock_table_enqueue_waiting(), lock_rec_enqueue_waiting(): Do not complain
about lock waits if the dictionary mode is TRX_DICT_OP_INDEX_MAY_WAIT.
row_merge_lock_table(): Remove the work-around for avoiding the warning
in lock_table_enqueue_waiting().
trx_undo_mark_as_dict_operation(): Do not write trx->table_id to the
undo log unless the dict_operation is TRX_DICT_OP_TABLE.
ha_innobase::add_index(): Set the dict_operation mode initially to
TRX_DICT_OP_INDEX_MAY_WAIT, then lock the table exclusively, and set the
mode to TRX_DICT_OP_INDEX, and optionally to TRX_DICT_OP_TABLE when
creating a temporary table.
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().
fix the bugs introduced in r1591.
row_rec_to_index_entry_low(): Clear "n_ext". Do not allow it to be NULL.
Add const qualifier to dict_index_t*.
row_rec_to_index_entry(): Add the parameters "offsets" and "n_ext".
btr_cur_optimistic_update(): Add an assertion that there are no externally
stored columns. Remove the unreachable call to btr_cur_unmark_extern_fields()
and the preceding unnecessary call to rec_get_offsets().
btr_push_update_extern_fields(): Remove the parameters index, offsets.
Only report the additional externally stored columns of the update vector.
row_build(), trx_undo_rec_get_partial_row(): Flag externally stored columns
also with dfield_set_ext().
rec_copy_prefix_to_dtuple(): Assert that there are no externally stored
columns in the prefix.
row_build_row_ref(): Note and assert that the index is a secondary index,
and assert that there are no externally stored columns.
row_build_row_ref_fast(): Assert that there are no externally stored columns.
rec_offs_get_n_alloc(): Expose the function.
row_build_row_ref_in_tuple(): Assert that there are no externally stored
columns in a record of a secondary index.
row_build_row_ref_from_row(): Assert that there are no externally stored
columns.
row_upd_check_references_constraints(): Add the parameter offsets, to
avoid a redundant call to rec_get_offsets().
row_upd_del_mark_clust_rec(): Add the parameter offsets. Remove
duplicated code.
row_ins_index_entry_set_vals(): Copy the external storage flag.
sel_pop_prefetched_row(): Assert that there are no externally stored
columns.
row_scan_and_check_index(): Copy offsets to a temporary heap across
the invocation of row_rec_to_index_entry().
and use it for flagging externally stored columns in the data tuple.
The data tuple contains the same columns as the clustered index record,
but in a different order. This error was introduced in r1591.
TODO: the assertion ut_ad(!dfield_is_ext()) may fail in
btr_cur_pessimistic_update().
Do not assume anything about the contents of the bitmap.
ibuf_update_free_bits_low(): Use this function only for uncompressed pages.
Remove the parameter zip_size. This function avoids latching the bitmap page
and updating the bitmap when the bits do not change.
ibuf_update_free_bits_zip(): New function based on ibuf_update_free_bits_low(),
for use on compressed pages. Remove the parameter max_insert_size that
was used for computing the before image of the free bits. Always update the
bitmap.
ibuf_index_page_calc_free_zip(): New function, factored out from
ibuf_index_page_calc_free().
ibuf_update_free_bits_if_full(): Document that this function must only be
invoked on uncompressed pages. Add a debug assertion about this.
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.
buf_block_hash_get(): New function, similar to buf_page_hash_get().
buf_page_get_block(): Remove the const qualifiers. This is a low-level
function, and the operations on block->mutex are non-const.
buf_page_try_get_func(): Implement with lower-level predicates, somewhat
similar to buf_page_get_known_nowait().
lock_rec_print(): Remove the unused variable zip_size and the
call to fil_space_get_zip_size(). Adapt to buf_page_try_get() returning
a const pointer.
offsets_[] arrays, as suggested by Vasil.
rec_offs_set_n_alloc(): Declare as a public function. Assert that
n_alloc > REC_OFFS_HEADER_SIZE.
rec_offs_get_n_alloc(): Assert that n_alloc > REC_OFFS_HEADER_SIZE.
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
Fix a bug where the condition (prtype & DATA_ROW_ID) is unexpectedly
always false becasue DATA_ROW_ID is 0.
Use a switch instead of if-else in order to avoid repeating
(prtype & DATA_SYS_PRTYPE_MASK).
Approved by: Heikki
innobase_col_to_mysql(): New function, adapted from
row_sel_field_store_in_mysql_format().
innobase_rec_to_mysql(): Correct the function comment, which was still
saying "clustered index record", although we can convert any record.
Make use of innobase_col_to_mysql(). Always call field->reset(),
so that innobase_col_to_mysql() will not have to pad anything.
dtuple_create_for_mysql(), dtuple_free_for_mysql(): Remove.
ha_innobase::records_in_range(): Use mem_heap_create(), mem_heap_free(),
and dtuple_create() instead of the removed functions above. Since r1587,
InnoDB C++ functions can invoke inlined C functions.
innobase_rec_to_mysql(): New function, for converting an InnoDB clustered
index record to MySQL table->record[0]. TODO: convert integer fields.
Currently, integer fields are in big-endian byte order instead of
host byte order, and signed integer fields are offset by 0x80000000.
innobase_rec_reset(): New function, for resetting table->record[0].
row_merge_build_indexes(): Add the parameter TABLE* table (the MySQL table
handle) for reporting duplicate key values.
dtuple_from_fields(): New function, to convert an array of dfield_t* to
dtuple_t.
dtuple_get_n_ext(): New function, to compute the number of externally stored
fields.
row_merge_dup_t: Structure for counting and reporting duplicate records.
row_merge_dup_report(): Function for counting and reporting duplicate records.
row_merge_tuple_cmp(), row_merge_tuple_sort(): Replace the ulint* n_dup
parameter with row_merge_dup_t* dup.
row_merge_buf_sort(): Add the parameter row_merge_dup_t* dup, which is
NULL when sorting a non-unique index.
row_merge_buf_write(), row_merge_heap_create(), row_merge_read_rec(),
row_merge_cmp(), row_merge_read_clustered_index(), row_merge_blocks(),
row_merge(), row_merge_sort(): Add const qualifiers.
row_merge_read_clustered_index(): Use a common error handling branch err_exit.
Invoke row_merge_buf_sort() differently on unique indexes.
row_merge_blocks(): note TODO: We could invoke innobase_rec_to_mysql()
to report duplicate key values when creating a clustered index.
dict_find_index_by_max_id(): Rename this static function to its
only caller, dict_table_get_index_by_max_id().
dict_table_get_index_by_max_id(): Copy the function comment from
dict_find_index_by_max_id().
rec_get_converted_size_comp(), rec_convert_dtuple_to_rec_comp(),
rec_convert_dtuple_to_rec_new(), rec_convert_dtuple_to_rec(): Add a
const qualifier to dict_index_t*.
row_search_on_row_ref(): Add const qualifiers to the dict_table_t*
and dtuple_t* parameters. Note that pcur is an "out" parameter
and mtr is "in/out".
dtuple_create(): Simplify a pointer expression. Flag the fields uninitialized
after initializing them in the debug version.
dtuple_t: Only declare magic_n if UNIV_DEBUG is defined. The field is
not assigned to nor tested unless UNIV_DEBUG is defined.
Add a type that stores chunks of data in its own storage and avoids
duplicates. Supported methods:
ha_storage_create()
Allocates new storage object.
ha_storage_put()
Copies a given data chunk into the storage and returns pointer to the
copy. If the data chunk is already present, a pointer to the existing
object is returned and the given data chunk is not copied.
ha_storage_empty()
Clears (empties) the storage from all data chunks that are stored in it.
ha_storage_free()
Destroys a storage object. Opposite to ha_storage_create().
Approved by: Marko
mem_alloc2(): New macro. This is a variant of mem_alloc() that
returns the allocated size, which is equal to or greater than
the requested size.
mem_alloc_func(): Add the output parameter *size for the allocated size.
When it is set, adjust the parameter passed to mem_heap_alloc().
rec_copy_prefix_to_buf_old(), rec_copy_prefix_to_buf(): Use mem_alloc2()
instead of mem_alloc().
was actually obtained from the buddy allocator. This should avoid some
internal memory fragmentation in mem_heap_create() and mem_heap_alloc().
mem_area_alloc(): Change the in parameter size to an in/out parameter.
Adjust the size based on what was obtained from pool->free_list[].
mem_heap_create_block(): Adjust block->len to what was obtained from
mem_area_alloc().