value. Document this change in behaviour, and make all callers invoke
the function right after dtuple_create().
dict_create_sys_fields_tuple(): Add a missing "break" statement to the loop
that checks if there are any column prefixes in the index.
row_get_prebuilt_insert_row(): Do not set the fields to the SQL NULL value,
now that dict_table_copy_types() takes care of it.
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.
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().
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.
row_add_table_to_background_drop_list(): Replace the dict_table_t*
parameter with const char* (the table name).
row_check_table_for_mysql(): Replace prebuilt->table with table.
trx_t: Remove dict_undo_list and dict_redo_list.
innobase_create_temporary_tablename(): Replace TEMP_TABLE_PREFIX with
a table name suffix "#1" or "#2". In this way, the user can restore
precious data, should anything go wrong. It is possible to reach an
inconsistent state, because the creation, deletion and renaming of
single-table tablespaces are not transactional.
ut_print_namel(), fil_make_ibd_name(), innobase_rename_table(): Remove
the special treatment of TEMP_TABLE_PREFIX.
Introduce TEMP_INDEX_PREFIX == 0xff for temporary indexes. This byte
cannot occur in index names since MySQL 4.1. However, it might have
been possible to use this byte in MySQL 4.0.
recv_recovery_from_checkpoint_finish(): Call the new function
row_merge_drop_temp_indexes(), to drop all indexes whose name starts
with the byte 0xff.
row_merge_rename_indexes(): Renamed from row_merge_rename_index().
Remove the parameter "index".
row_drop_table_for_mysql(): Unconditionally call trx_commit_for_mysql().
row_drop_table_for_mysql_no_commit(): Correct the function commit,
based on the corrected comment of row_drop_table_for_mysql(). Rely on
table->to_be_dropped instead of TEMP_TABLE_PREFIX.
ha_innobase::add_index(): Simplify the control flow.
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.
ha_innobase::add_index(): Add assertions about !trx->sync_cb and
!trx->dict_redo_list. Remove a bogus comment. Replace
row_lock_table_for_merge() with row_merge_lock_table().
row_merge_lock_table(): Renamed from row_lock_table_for_merge()
and moved from row0mysql.c to row0merge.c. Always lock the table in
the mode LOCK_X. Call que_graph_free() in order not to leak memory.
mem_heap_zalloc() and mem_zalloc(), because calloc() in the C runtime
library takes two size parameters, not one.
mem_heap_zalloc(): Add debug assertions. Document that the return value
is never NULL.
(merging branches/fast-index-creation):
row_truncate_table_for_mysql(), row_drop_table_for_mysql_no_commit():
Let ut_print_name() output to ef instead of stderr.
innobase_create_key_def(), row_table_got_default_clust_index(),
row_get_mysql_key_number_for_index(): Add a const qualifier.
dict_table_get_first_index(), dict_table_get_next_index(): Define
as a const-preserving macro. Preserve the old function for UNIV_DEBUG,
but add a const qualifier to the parameter and cast away the constness.
row_mysql_read_true_varchar(), row_mysql_read_blob_ref(),
row_mysql_store_col_in_innobase_format(),
row_sel_convert_mysql_key_to_innobase(): Add const qualifiers.
row_sel_convert_mysql_key_to_innobase(): Document that the first parameter
is in/out.
the data dictionary locked across the operations.
dict_table_decrement_handle_count(), row_prebuilt_free(): Add the flag
dict_locked, to prevent the acquisition of dict_sys->mutex.
innobase_rename_table(): Rename commit_flag to lock_and_commit,
and do not acquire dict_sys->mutex or flush the log unless the flag is set.
Remove bogus comment about utility threads, because the threads will
be waken up by the upper-level function ha_innobase::rename_table().
ha_innobase::add_index(): After creating a primary key, hold dict_sys->mutex
across all dictionary operations.
Some things still fail in innodb-index.test, and there seems to be
a race condition (data dictionary lock wait) when running with --valgrind.
dfield_t: Add an "external storage" flag, dfield->ext.
dfield_is_null(), dfield_is_ext(), dfield_set_ext(), dfield_set_null():
New functions.
dfield_copy(), dfield_copy_data(): Add const qualifiers, fix in/out comments.
data_write_sql_null(): Use memset().
big_rec_field_t: Replace byte* data with const void* data.
ut_ulint_sort(): Remove.
upd_field_t: Remove extern_storage.
upd_node_t: Replace ext_vec, n_ext_vec with n_ext.
row_merge_copy_blobs(): New function.
row_ins_index_entry(): Add the parameter "ibool foreign" for suppressing
foreign key checks during fast index creation or when inserting into
secondary indexes.
btr_page_insert_fits(): Add const qualifiers.
btr_cur_add_ext(), upd_ext_vec_contains(): Remove.
dfield_print_also_hex(), dfield_print(): Replace if...else if with switch.
Observe dfield_is_ext().
Because row_drop_table_for_mysql_no_commit() checks with dict_load_table()
if the table was successfully dropped, we cannot pass table->name to it.
row_merge_drop_table(): Pass a copy of table->name to
row_drop_table_for_mysql().
row_prebuilt_free(): Do not dereference prebuilt->table->name after a
successful invocation of row_add_table_to_background_drop_list(). The
table object may be freed at any time. Remove the debug message
"Dropping table".
during fast index creation.
TEMP_TABLE_PREFIX: Move the definition from dict0dict.h to ut0ut.h.
ut_print_namel(): Check if the name starts with TEMP_TABLE_PREFIX.
innobase_rename_table(): Print all names with ut_print_name().
row_prebuilt_free(): Replace assert() with ut_a().
comparing uninitialized values.
dict_mem_table_create(): Initialize table->version_number.
ins_node_create(): Initialize node->table_version_number.
row_create_prebuilt(): Initialize all fields. Initialize most fields
by memset(), so that any fields that are added will be initialized
automatically.
The creation of the primary key does not work. We will have to flag
externally stored columns and copy the externally stored part from
the old table.
row_build_index_for_mysql(): Rename to row_merge_build_indexes().
Move from row0mysql.c to row0merge.c.
Remove private declarations from row0merge.h. Make many functions static
in row0merge.c.
cmp_rec_rec_simple(): A new comparison function.
dict_index_get_min_size(): New function.
OS_FILE_FROM_FD(fd): A macro for converting from int to os_file_t.
rec_convert_dtuple_to_rec_comp(): Make the interface lower-level.
rec_get_converted_size_comp(): Return also extra_size.
UT_SORT_FUNCTION_BODY(): Remove reference to an obsolete test program.
row_rec_to_index_entry_low(): New function.
row0merge.c: Implement merge sort based on file streams instead of
fixed-size blocks. Sort the small blocks as arrays of dfield_t*,
because it is faster than invoking rec_get_offsets() for every
comparison.
row_merge_mark_prebuilt_obsolete(): Rename to row_prebuilt_table_obsolete()
and move from row0merge.c to row0mysql.c. Remove the parameter trx.
row_merge_print_table(): Remove.
row_remove_indexes_for_mysql(): Rename to row_merge_drop_indexes(),
move from row0mysql.c to row0merge.c and make the return type void.
row_merge_remove_index(): Rename to row_merge_drop_index() and make
the return type void.
Replace byte offsets of type dulint with block offsets of type ulint.
Avoid references to MERGE_BLOCK_SIZE.
Improve the language of some comments.
row_merge_insert_index_tuples(), row_merge_sort_linked_list_in_disk():
Make the offset a ulint.
row_merge_read(), row_merge_write(): Helper functions. Return the
status of os_file_read() and os_file_write(). TO DO: check the status
in the callers.
innobase_create_temporary_tablename(): Add static qualifier. Allocate
the memory from heap. Return a fixed identifier.
ha_innobase::add_index(): Allocate all memory from a single heap.
Simplify error handling. Use a fixed prefix for temporary table names,
because only one add_index() can be active for a given table.
mem_heap_empty_noninline(): New function, to be called from ha_innodb.cc.
row_build_index_for_mysql(): Remove the parameter new_primary.
Define the merge_rec_ structures in row0merge.c instead of
row0merge.h. They are not used in the interface defined in row0merge.h.
row_merge_create_file_structure(): Rename to row_merge_file_create().
Input a pointer to a pre-allocated block of memory.
row_merge_read_clustered_index(): Replace merge_file_t** with merge_file_t*.
row_merge_sort_and_insert_thread(): Remove the declaration.
This function was never defined or called.
row_merge_is_index_usable(): Correct the formatting.
row_build_index_for_mysql(): Allocate an array of merge_file_t instead
of an array of pointers to merge_file_t.
dict_truncate_index_tree(): Add the parameter space for specifying the
new tablespace identifier of a single-table tablespace that has been
recreated. When SYS_INDEXES.PAGE_NO == FIL_NULL, do not abort but
create the index tree.
fil_discard_tablespace(): Pass the return code from fil_delete_tablespace().
row_truncate_table_for_mysql(): Attempt to discard and recreate
single-table tablespaces. Reassign the tablespace identifier both in
the data dictionary (SYS_TABLES and SYS_INDEXES) and in the data
dictionary cache.