Loading innobase/dict/dict0dict.c +23 −0 Original line number Diff line number Diff line Loading @@ -3689,6 +3689,29 @@ dict_tree_find_index_for_tuple( return(index); } /*********************************************************************** Checks if a table which is a mixed cluster member owns a record. */ ibool dict_is_mixed_table_rec( /*====================*/ /* out: TRUE if the record belongs to this table */ dict_table_t* table, /* in: table in a mixed cluster */ rec_t* rec) /* in: user record in the clustered index */ { byte* mix_id_field; ulint len; ut_ad(!table->comp); mix_id_field = rec_get_nth_field_old(rec, table->mix_len, &len); return(len == table->mix_id_len && !ut_memcmp(table->mix_id_buf, mix_id_field, len)); } /************************************************************************** Checks that a tuple has n_fields_cmp value in a sensible range, so that no comparison can occur with the page number field in a node pointer. */ Loading innobase/ibuf/ibuf0ibuf.c +4 −3 Original line number Diff line number Diff line Loading @@ -1140,7 +1140,8 @@ void ibuf_dummy_index_add_col( /*====================*/ dict_index_t* index, /* in: dummy index */ dtype_t* type) /* in: the data type of the column */ dtype_t* type, /* in: the data type of the column */ ulint len) /* in: length of the column */ { ulint i = index->table->n_def; dict_mem_table_add_col(index->table, "DUMMY", Loading @@ -1149,7 +1150,7 @@ ibuf_dummy_index_add_col( dtype_get_len(type), dtype_get_prec(type)); dict_index_add_col(index, dict_table_get_nth_col(index->table, i), 0, 0); dict_table_get_nth_col(index->table, i), 0, len); } /************************************************************************ Deallocates a dummy index for inserting a record to a non-clustered index. Loading Loading @@ -1259,7 +1260,7 @@ ibuf_build_entry_from_ibuf_rec( dfield_get_type(field), types + i * DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE); ibuf_dummy_index_add_col(index, dfield_get_type(field)); ibuf_dummy_index_add_col(index, dfield_get_type(field), len); } *pindex = index; Loading innobase/include/dict0dict.h +1 −14 Original line number Diff line number Diff line Loading @@ -657,19 +657,6 @@ dict_index_copy_types( dtuple_t* tuple, /* in: data tuple */ dict_index_t* index, /* in: index */ ulint n_fields); /* in: number of field types to copy */ /************************************************************************ Gets the value of a system column in a clustered index record. The clustered index must contain the system column: if the index is unique, row id is not contained there! */ UNIV_INLINE dulint dict_index_rec_get_sys_col( /*=======================*/ /* out: system column value */ dict_index_t* index, /* in: clustered index describing the record */ const ulint* offsets,/* in: offsets returned by rec_get_offsets() */ ulint type, /* in: column type: DATA_ROLL_PTR, ... */ rec_t* rec); /* in: record */ /************************************************************************* Gets the index tree where the index is stored. */ UNIV_INLINE Loading Loading @@ -731,7 +718,7 @@ dict_tree_find_index_for_tuple( dtuple_t* tuple); /* in: tuple for which to find index */ /*********************************************************************** Checks if a table which is a mixed cluster member owns a record. */ UNIV_INLINE ibool dict_is_mixed_table_rec( /*====================*/ Loading innobase/include/dict0dict.ic +0 −74 Original line number Diff line number Diff line Loading @@ -9,7 +9,6 @@ Created 1/8/1996 Heikki Tuuri #include "dict0load.h" #include "trx0undo.h" #include "trx0sys.h" #include "rem0rec.h" /************************************************************************* Gets the column data type. */ Loading Loading @@ -312,51 +311,6 @@ dict_index_get_sys_col_pos( dict_table_get_sys_col_no(index->table, type))); } /************************************************************************ Gets the value of a system column in a clustered index record. The clustered index must contain the system column: if the index is unique, row id is not contained there! */ UNIV_INLINE dulint dict_index_rec_get_sys_col( /*=======================*/ /* out: system column value */ dict_index_t* index, /* in: clustered index describing the record */ const ulint* offsets,/* in: offsets returned by rec_get_offsets() */ ulint type, /* in: column type: DATA_ROLL_PTR, ... */ rec_t* rec) /* in: record */ { ulint pos; byte* field; ulint len; ut_ad(index); ut_ad(index->type & DICT_CLUSTERED); ut_ad(rec_offs_validate(rec, index, offsets)); pos = dict_index_get_sys_col_pos(index, type); ut_ad(pos != ULINT_UNDEFINED); field = rec_get_nth_field(rec, offsets, pos, &len); if (type == DATA_ROLL_PTR) { ut_ad(len == 7); return(trx_read_roll_ptr(field)); } else if (type == DATA_TRX_ID) { return(trx_read_trx_id(field)); } else if (type == DATA_MIX_ID) { return(mach_dulint_read_compressed(field)); } else { ut_a(type == DATA_ROW_ID); return(mach_read_from_6(field)); } } /************************************************************************* Gets the index tree where the index is stored. */ UNIV_INLINE Loading Loading @@ -664,31 +618,3 @@ dict_table_get_index( return(index); } /*********************************************************************** Checks if a table which is a mixed cluster member owns a record. */ UNIV_INLINE ibool dict_is_mixed_table_rec( /*====================*/ /* out: TRUE if the record belongs to this table */ dict_table_t* table, /* in: table in a mixed cluster */ rec_t* rec) /* in: user record in the clustered index */ { byte* mix_id_field; ulint len; ut_ad(!table->comp); mix_id_field = rec_get_nth_field_old(rec, table->mix_len, &len); if ((len != table->mix_id_len) || (0 != ut_memcmp(table->mix_id_buf, mix_id_field, len))) { return(FALSE); } return(TRUE); } innobase/trx/trx0rec.c +9 −4 Original line number Diff line number Diff line Loading @@ -485,10 +485,15 @@ trx_undo_page_report_modify( ptr += 1; /* Store the values of the system columns */ trx_id = dict_index_rec_get_sys_col(index, offsets, DATA_TRX_ID, rec); roll_ptr = dict_index_rec_get_sys_col(index, offsets, DATA_ROLL_PTR, rec); field = rec_get_nth_field(rec, offsets, dict_index_get_sys_col_pos(index, DATA_TRX_ID), &len); ut_ad(len == DATA_TRX_ID_LEN); trx_id = trx_read_trx_id(field); field = rec_get_nth_field(rec, offsets, dict_index_get_sys_col_pos(index, DATA_ROLL_PTR), &len); ut_ad(len == DATA_ROLL_PTR_LEN); roll_ptr = trx_read_roll_ptr(field); len = mach_dulint_write_compressed(ptr, trx_id); ptr += len; Loading Loading
innobase/dict/dict0dict.c +23 −0 Original line number Diff line number Diff line Loading @@ -3689,6 +3689,29 @@ dict_tree_find_index_for_tuple( return(index); } /*********************************************************************** Checks if a table which is a mixed cluster member owns a record. */ ibool dict_is_mixed_table_rec( /*====================*/ /* out: TRUE if the record belongs to this table */ dict_table_t* table, /* in: table in a mixed cluster */ rec_t* rec) /* in: user record in the clustered index */ { byte* mix_id_field; ulint len; ut_ad(!table->comp); mix_id_field = rec_get_nth_field_old(rec, table->mix_len, &len); return(len == table->mix_id_len && !ut_memcmp(table->mix_id_buf, mix_id_field, len)); } /************************************************************************** Checks that a tuple has n_fields_cmp value in a sensible range, so that no comparison can occur with the page number field in a node pointer. */ Loading
innobase/ibuf/ibuf0ibuf.c +4 −3 Original line number Diff line number Diff line Loading @@ -1140,7 +1140,8 @@ void ibuf_dummy_index_add_col( /*====================*/ dict_index_t* index, /* in: dummy index */ dtype_t* type) /* in: the data type of the column */ dtype_t* type, /* in: the data type of the column */ ulint len) /* in: length of the column */ { ulint i = index->table->n_def; dict_mem_table_add_col(index->table, "DUMMY", Loading @@ -1149,7 +1150,7 @@ ibuf_dummy_index_add_col( dtype_get_len(type), dtype_get_prec(type)); dict_index_add_col(index, dict_table_get_nth_col(index->table, i), 0, 0); dict_table_get_nth_col(index->table, i), 0, len); } /************************************************************************ Deallocates a dummy index for inserting a record to a non-clustered index. Loading Loading @@ -1259,7 +1260,7 @@ ibuf_build_entry_from_ibuf_rec( dfield_get_type(field), types + i * DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE); ibuf_dummy_index_add_col(index, dfield_get_type(field)); ibuf_dummy_index_add_col(index, dfield_get_type(field), len); } *pindex = index; Loading
innobase/include/dict0dict.h +1 −14 Original line number Diff line number Diff line Loading @@ -657,19 +657,6 @@ dict_index_copy_types( dtuple_t* tuple, /* in: data tuple */ dict_index_t* index, /* in: index */ ulint n_fields); /* in: number of field types to copy */ /************************************************************************ Gets the value of a system column in a clustered index record. The clustered index must contain the system column: if the index is unique, row id is not contained there! */ UNIV_INLINE dulint dict_index_rec_get_sys_col( /*=======================*/ /* out: system column value */ dict_index_t* index, /* in: clustered index describing the record */ const ulint* offsets,/* in: offsets returned by rec_get_offsets() */ ulint type, /* in: column type: DATA_ROLL_PTR, ... */ rec_t* rec); /* in: record */ /************************************************************************* Gets the index tree where the index is stored. */ UNIV_INLINE Loading Loading @@ -731,7 +718,7 @@ dict_tree_find_index_for_tuple( dtuple_t* tuple); /* in: tuple for which to find index */ /*********************************************************************** Checks if a table which is a mixed cluster member owns a record. */ UNIV_INLINE ibool dict_is_mixed_table_rec( /*====================*/ Loading
innobase/include/dict0dict.ic +0 −74 Original line number Diff line number Diff line Loading @@ -9,7 +9,6 @@ Created 1/8/1996 Heikki Tuuri #include "dict0load.h" #include "trx0undo.h" #include "trx0sys.h" #include "rem0rec.h" /************************************************************************* Gets the column data type. */ Loading Loading @@ -312,51 +311,6 @@ dict_index_get_sys_col_pos( dict_table_get_sys_col_no(index->table, type))); } /************************************************************************ Gets the value of a system column in a clustered index record. The clustered index must contain the system column: if the index is unique, row id is not contained there! */ UNIV_INLINE dulint dict_index_rec_get_sys_col( /*=======================*/ /* out: system column value */ dict_index_t* index, /* in: clustered index describing the record */ const ulint* offsets,/* in: offsets returned by rec_get_offsets() */ ulint type, /* in: column type: DATA_ROLL_PTR, ... */ rec_t* rec) /* in: record */ { ulint pos; byte* field; ulint len; ut_ad(index); ut_ad(index->type & DICT_CLUSTERED); ut_ad(rec_offs_validate(rec, index, offsets)); pos = dict_index_get_sys_col_pos(index, type); ut_ad(pos != ULINT_UNDEFINED); field = rec_get_nth_field(rec, offsets, pos, &len); if (type == DATA_ROLL_PTR) { ut_ad(len == 7); return(trx_read_roll_ptr(field)); } else if (type == DATA_TRX_ID) { return(trx_read_trx_id(field)); } else if (type == DATA_MIX_ID) { return(mach_dulint_read_compressed(field)); } else { ut_a(type == DATA_ROW_ID); return(mach_read_from_6(field)); } } /************************************************************************* Gets the index tree where the index is stored. */ UNIV_INLINE Loading Loading @@ -664,31 +618,3 @@ dict_table_get_index( return(index); } /*********************************************************************** Checks if a table which is a mixed cluster member owns a record. */ UNIV_INLINE ibool dict_is_mixed_table_rec( /*====================*/ /* out: TRUE if the record belongs to this table */ dict_table_t* table, /* in: table in a mixed cluster */ rec_t* rec) /* in: user record in the clustered index */ { byte* mix_id_field; ulint len; ut_ad(!table->comp); mix_id_field = rec_get_nth_field_old(rec, table->mix_len, &len); if ((len != table->mix_id_len) || (0 != ut_memcmp(table->mix_id_buf, mix_id_field, len))) { return(FALSE); } return(TRUE); }
innobase/trx/trx0rec.c +9 −4 Original line number Diff line number Diff line Loading @@ -485,10 +485,15 @@ trx_undo_page_report_modify( ptr += 1; /* Store the values of the system columns */ trx_id = dict_index_rec_get_sys_col(index, offsets, DATA_TRX_ID, rec); roll_ptr = dict_index_rec_get_sys_col(index, offsets, DATA_ROLL_PTR, rec); field = rec_get_nth_field(rec, offsets, dict_index_get_sys_col_pos(index, DATA_TRX_ID), &len); ut_ad(len == DATA_TRX_ID_LEN); trx_id = trx_read_trx_id(field); field = rec_get_nth_field(rec, offsets, dict_index_get_sys_col_pos(index, DATA_ROLL_PTR), &len); ut_ad(len == DATA_ROLL_PTR_LEN); roll_ptr = trx_read_roll_ptr(field); len = mach_dulint_write_compressed(ptr, trx_id); ptr += len; Loading