Remove unused parameters and dead code
upd_field_set_field_no(): Remove the unused parameter trx, and remove a debug message. In debug builds, the out-of-bounds access would still be caught by dict_index_get_nth_col(). trx_undo_update_rec_get_update(): Remove the unnecessary parameter trx.
This commit is contained in:
parent
358ab5d6b1
commit
7cd4a66de6
@ -87,8 +87,7 @@ upd_field_set_field_no(
|
||||
upd_field_t* upd_field, /*!< in: update vector field */
|
||||
ulint field_no, /*!< in: field number in a clustered
|
||||
index */
|
||||
dict_index_t* index, /*!< in: index */
|
||||
trx_t* trx); /*!< in: transaction */
|
||||
dict_index_t* index);
|
||||
|
||||
/** set field number to a update vector field, marks this field is updated
|
||||
@param[in,out] upd_field update vector field
|
||||
|
@ -95,22 +95,10 @@ upd_field_set_field_no(
|
||||
upd_field_t* upd_field, /*!< in: update vector field */
|
||||
ulint field_no, /*!< in: field number in a clustered
|
||||
index */
|
||||
dict_index_t* index, /*!< in: index */
|
||||
trx_t* trx) /*!< in: transaction */
|
||||
dict_index_t* index) /*!< in: index */
|
||||
{
|
||||
upd_field->field_no = unsigned(field_no);
|
||||
upd_field->orig_len = 0;
|
||||
|
||||
if (UNIV_UNLIKELY(field_no >= dict_index_get_n_fields(index))) {
|
||||
ib::error()
|
||||
<< " trying to access field " << field_no
|
||||
<< " in " << index->name
|
||||
<< " of table " << index->table->name
|
||||
<< " which contains only " << index->n_fields
|
||||
<< " fields";
|
||||
ut_ad(0);
|
||||
}
|
||||
|
||||
dict_col_copy_type(dict_index_get_nth_col(index, field_no),
|
||||
dfield_get_type(&upd_field->new_val));
|
||||
}
|
||||
|
@ -152,7 +152,6 @@ trx_undo_update_rec_get_update(
|
||||
trx_id_t trx_id, /*!< in: transaction id from this undorecord */
|
||||
roll_ptr_t roll_ptr,/*!< in: roll pointer from this undo record */
|
||||
ulint info_bits,/*!< in: info bits from this undo record */
|
||||
trx_t* trx, /*!< in: transaction */
|
||||
mem_heap_t* heap, /*!< in: memory heap from which the memory
|
||||
needed is allocated */
|
||||
upd_t** upd); /*!< out, own: update vector */
|
||||
|
@ -1180,7 +1180,7 @@ pars_process_assign_list(
|
||||
upd_field_set_field_no(upd_field, dict_index_get_nth_col_pos(
|
||||
clust_index, col_sym->col_no,
|
||||
NULL),
|
||||
clust_index, NULL);
|
||||
clust_index);
|
||||
upd_field->exp = assign_node->val;
|
||||
|
||||
if (!dict_col_get_fixed_size(
|
||||
|
@ -819,7 +819,6 @@ row_purge_parse_undo_rec(
|
||||
{
|
||||
dict_index_t* clust_index;
|
||||
byte* ptr;
|
||||
trx_t* trx;
|
||||
undo_no_t undo_no;
|
||||
table_id_t table_id;
|
||||
trx_id_t trx_id;
|
||||
@ -911,10 +910,8 @@ err_exit:
|
||||
ptr = trx_undo_rec_get_row_ref(ptr, clust_index, &(node->ref),
|
||||
node->heap);
|
||||
|
||||
trx = thr_get_trx(thr);
|
||||
|
||||
ptr = trx_undo_update_rec_get_update(ptr, clust_index, type, trx_id,
|
||||
roll_ptr, info_bits, trx,
|
||||
roll_ptr, info_bits,
|
||||
node->heap, &(node->update));
|
||||
|
||||
/* Read to the partial row the fields that occur in indexes */
|
||||
|
@ -1160,7 +1160,7 @@ close_table:
|
||||
node->heap);
|
||||
|
||||
ptr = trx_undo_update_rec_get_update(ptr, clust_index, type, trx_id,
|
||||
roll_ptr, info_bits, node->trx,
|
||||
roll_ptr, info_bits,
|
||||
node->heap, &(node->update));
|
||||
node->new_trx_id = trx_id;
|
||||
node->cmpl_info = cmpl_info;
|
||||
|
@ -1006,7 +1006,7 @@ row_upd_build_sec_rec_difference_binary(
|
||||
|
||||
dfield_copy(&(upd_field->new_val), dfield);
|
||||
|
||||
upd_field_set_field_no(upd_field, i, index, NULL);
|
||||
upd_field_set_field_no(upd_field, i, index);
|
||||
|
||||
n_diff++;
|
||||
}
|
||||
@ -1103,7 +1103,7 @@ row_upd_build_difference_binary(
|
||||
|
||||
dfield_copy(&(upd_field->new_val), dfield);
|
||||
|
||||
upd_field_set_field_no(upd_field, i, index, trx);
|
||||
upd_field_set_field_no(upd_field, i, index);
|
||||
|
||||
n_diff++;
|
||||
}
|
||||
|
@ -1453,7 +1453,6 @@ trx_undo_update_rec_get_update(
|
||||
trx_id_t trx_id, /*!< in: transaction id from this undo record */
|
||||
roll_ptr_t roll_ptr,/*!< in: roll pointer from this undo record */
|
||||
ulint info_bits,/*!< in: info bits from this undo record */
|
||||
trx_t* trx, /*!< in: transaction */
|
||||
mem_heap_t* heap, /*!< in: memory heap from which the memory
|
||||
needed is allocated */
|
||||
upd_t** upd) /*!< out, own: update vector */
|
||||
@ -1489,7 +1488,7 @@ trx_undo_update_rec_get_update(
|
||||
|
||||
upd_field_set_field_no(upd_field,
|
||||
dict_index_get_sys_col_pos(index, DATA_TRX_ID),
|
||||
index, trx);
|
||||
index);
|
||||
dfield_set_data(&(upd_field->new_val), buf, DATA_TRX_ID_LEN);
|
||||
|
||||
upd_field = upd_get_nth_field(update, n_fields + 1);
|
||||
@ -1500,7 +1499,7 @@ trx_undo_update_rec_get_update(
|
||||
|
||||
upd_field_set_field_no(
|
||||
upd_field, dict_index_get_sys_col_pos(index, DATA_ROLL_PTR),
|
||||
index, trx);
|
||||
index);
|
||||
dfield_set_data(&(upd_field->new_val), buf, DATA_ROLL_PTR_LEN);
|
||||
|
||||
/* Store then the updated ordinary columns to the update vector */
|
||||
@ -1561,7 +1560,7 @@ trx_undo_update_rec_get_update(
|
||||
upd_field_set_v_field_no(
|
||||
upd_field, field_no, index);
|
||||
} else {
|
||||
upd_field_set_field_no(upd_field, field_no, index, trx);
|
||||
upd_field_set_field_no(upd_field, field_no, index);
|
||||
}
|
||||
|
||||
ptr = trx_undo_rec_get_col_val(ptr, &field, &len, &orig_len);
|
||||
@ -2247,7 +2246,7 @@ trx_undo_prev_version_build(
|
||||
|
||||
ptr = trx_undo_update_rec_get_update(ptr, index, type, trx_id,
|
||||
roll_ptr, info_bits,
|
||||
NULL, heap, &update);
|
||||
heap, &update);
|
||||
ut_a(ptr);
|
||||
|
||||
if (row_upd_changes_field_size_or_external(index, offsets, update)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user