mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 21:12:26 +01:00
Merge dict_index_copy_rec_order_prefix() to its only caller
btr_pcur_store_position(): Merge the code from dict_index_copy_rec_order_prefix().
This commit is contained in:
parent
3fe0369309
commit
3a393f8c84
3 changed files with 18 additions and 58 deletions
|
@ -174,10 +174,25 @@ btr_pcur_store_position(
|
|||
cursor->rel_pos = BTR_PCUR_ON;
|
||||
}
|
||||
|
||||
cursor->old_rec = dict_index_copy_rec_order_prefix(
|
||||
index, rec, &cursor->old_n_fields,
|
||||
&cursor->old_rec_buf, &cursor->buf_size);
|
||||
if (index->is_ibuf()) {
|
||||
ut_ad(!index->table->not_redundant());
|
||||
cursor->old_n_fields = rec_get_n_fields_old(rec);
|
||||
} else if (page_rec_is_leaf(rec)) {
|
||||
cursor->old_n_fields = dict_index_get_n_unique_in_tree(index);
|
||||
} else if (index->is_spatial()) {
|
||||
ut_ad(dict_index_get_n_unique_in_tree_nonleaf(index)
|
||||
== DICT_INDEX_SPATIAL_NODEPTR_SIZE);
|
||||
/* For R-tree, we have to compare
|
||||
the child page numbers as well. */
|
||||
cursor->old_n_fields = DICT_INDEX_SPATIAL_NODEPTR_SIZE + 1;
|
||||
} else {
|
||||
cursor->old_n_fields = dict_index_get_n_unique_in_tree(index);
|
||||
}
|
||||
|
||||
cursor->old_rec = rec_copy_prefix_to_buf(rec, index,
|
||||
cursor->old_n_fields,
|
||||
&cursor->old_rec_buf,
|
||||
&cursor->buf_size);
|
||||
cursor->block_when_stored = block;
|
||||
|
||||
/* Function try to check if block is S/X latch. */
|
||||
|
|
|
@ -5462,46 +5462,6 @@ dict_index_build_node_ptr(
|
|||
return(tuple);
|
||||
}
|
||||
|
||||
/**********************************************************************//**
|
||||
Copies an initial segment of a physical record, long enough to specify an
|
||||
index entry uniquely.
|
||||
@return pointer to the prefix record */
|
||||
rec_t*
|
||||
dict_index_copy_rec_order_prefix(
|
||||
/*=============================*/
|
||||
const dict_index_t* index, /*!< in: index */
|
||||
const rec_t* rec, /*!< in: record for which to
|
||||
copy prefix */
|
||||
ulint* n_fields,/*!< out: number of fields copied */
|
||||
byte** buf, /*!< in/out: memory buffer for the
|
||||
copied prefix, or NULL */
|
||||
ulint* buf_size)/*!< in/out: buffer size */
|
||||
{
|
||||
ulint n;
|
||||
|
||||
UNIV_PREFETCH_R(rec);
|
||||
|
||||
if (dict_index_is_ibuf(index)) {
|
||||
ut_ad(!dict_table_is_comp(index->table));
|
||||
n = rec_get_n_fields_old(rec);
|
||||
} else {
|
||||
if (page_rec_is_leaf(rec)) {
|
||||
n = dict_index_get_n_unique_in_tree(index);
|
||||
} else if (dict_index_is_spatial(index)) {
|
||||
ut_ad(dict_index_get_n_unique_in_tree_nonleaf(index)
|
||||
== DICT_INDEX_SPATIAL_NODEPTR_SIZE);
|
||||
/* For R-tree, we have to compare
|
||||
the child page numbers as well. */
|
||||
n = DICT_INDEX_SPATIAL_NODEPTR_SIZE + 1;
|
||||
} else {
|
||||
n = dict_index_get_n_unique_in_tree(index);
|
||||
}
|
||||
}
|
||||
|
||||
*n_fields = n;
|
||||
return(rec_copy_prefix_to_buf(rec, index, n, buf, buf_size));
|
||||
}
|
||||
|
||||
/** Convert a physical record into a search tuple.
|
||||
@param[in] rec index record (not necessarily in an index page)
|
||||
@param[in] index index
|
||||
|
|
|
@ -1303,21 +1303,6 @@ dict_index_build_node_ptr(
|
|||
ulint level) /*!< in: level of rec in tree:
|
||||
0 means leaf level */
|
||||
MY_ATTRIBUTE((nonnull, warn_unused_result));
|
||||
/**********************************************************************//**
|
||||
Copies an initial segment of a physical record, long enough to specify an
|
||||
index entry uniquely.
|
||||
@return pointer to the prefix record */
|
||||
rec_t*
|
||||
dict_index_copy_rec_order_prefix(
|
||||
/*=============================*/
|
||||
const dict_index_t* index, /*!< in: index */
|
||||
const rec_t* rec, /*!< in: record for which to
|
||||
copy prefix */
|
||||
ulint* n_fields,/*!< out: number of fields copied */
|
||||
byte** buf, /*!< in/out: memory buffer for the
|
||||
copied prefix, or NULL */
|
||||
ulint* buf_size)/*!< in/out: buffer size */
|
||||
MY_ATTRIBUTE((nonnull, warn_unused_result));
|
||||
/** Convert a physical record into a search tuple.
|
||||
@param[in] rec index record (not necessarily in an index page)
|
||||
@param[in] index index
|
||||
|
|
Loading…
Reference in a new issue