Skip to content

Commit

Permalink
Minor code cleanup.
Browse files Browse the repository at this point in the history
dict_index_is_sec_or_ibuf(): Use a single arithmetic expression.

rtr_split_page_move_rec_list(): Remove a redundant condition on
dict_index_is_sec_or_ibuf(). This function is always invoked on
a spatial index, which also is a secondary index.
  • Loading branch information
dr-m committed Apr 17, 2017
1 parent bb81828 commit e5eef05
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 4 additions & 2 deletions storage/innobase/gis/gis0rtree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,9 @@ rtr_split_page_move_rec_list(
ulint max_to_move = 0;
rtr_rec_move_t* rec_move = NULL;

ut_ad(!dict_index_is_ibuf(index));
ut_ad(dict_index_is_spatial(index));

rec_offs_init(offsets_);

page_cur_set_before_first(block, &page_cursor);
Expand Down Expand Up @@ -907,8 +910,7 @@ rtr_split_page_move_rec_list(
same temp-table in parallel.
max_trx_id is ignored for temp tables because it not required
for MVCC. */
if (dict_index_is_sec_or_ibuf(index)
&& page_is_leaf(page)
if (page_is_leaf(page)
&& !dict_table_is_temporary(index->table)) {
page_update_max_trx_id(new_block, NULL,
page_get_max_trx_id(page),
Expand Down
6 changes: 1 addition & 5 deletions storage/innobase/include/dict0dict.ic
Original file line number Diff line number Diff line change
Expand Up @@ -393,13 +393,9 @@ dict_index_is_sec_or_ibuf(
/*======================*/
const dict_index_t* index) /*!< in: index */
{
ulint type;

ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);

type = index->type;

return(!(type & DICT_CLUSTERED) || (type & DICT_IBUF));
return((index->type & (DICT_CLUSTERED | DICT_IBUF)) != DICT_CLUSTERED);
}

/********************************************************************//**
Expand Down

0 comments on commit e5eef05

Please sign in to comment.