Commit 7d34b71c authored by marko's avatar marko

branches/zip: Introduce the accessor function dict_index_is_ibuf()

for determining if an index is the insert buffer B-tree.
parent f490a730
......@@ -322,7 +322,7 @@ btr_page_alloc(
buf_block_t* new_block;
ulint new_page_no;
if (index->type & DICT_IBUF) {
if (dict_index_is_ibuf(index)) {
return(btr_page_alloc_for_ibuf(index, mtr));
}
......@@ -446,7 +446,7 @@ btr_page_free_low(
buf_block_modify_clock_inc(block);
if (index->type & DICT_IBUF) {
if (dict_index_is_ibuf(index)) {
btr_page_free_for_ibuf(index, block, mtr);
......@@ -2757,7 +2757,7 @@ btr_print_size(
fseg_header_t* seg;
mtr_t mtr;
if (index->type & DICT_IBUF) {
if (dict_index_is_ibuf(index)) {
fputs("Sorry, cannot print info of an ibuf tree:"
" use ibuf functions\n", stderr);
......
......@@ -341,7 +341,7 @@ btr_cur_search_to_nth_level(
ut_ad(level == 0 || mode == PAGE_CUR_LE);
ut_ad(dict_index_check_search_tuple(index, tuple));
ut_ad(!(index->type & DICT_IBUF) || ibuf_inside());
ut_ad(!dict_index_is_ibuf(index) || ibuf_inside());
ut_ad(dtuple_check_typed(tuple));
#ifdef UNIV_DEBUG
......@@ -939,7 +939,7 @@ btr_cur_ins_lock_and_undo(
return(err);
}
if (dict_index_is_clust(index) && !(index->type & DICT_IBUF)) {
if (dict_index_is_clust(index) && !dict_index_is_ibuf(index)) {
err = trx_undo_report_row_operation(flags, TRX_UNDO_INSERT_OP,
thr, index, entry,
......
......@@ -233,7 +233,7 @@ btr_search_info_update_hash(
index = cursor->index;
if (index->type & DICT_IBUF) {
if (dict_index_is_ibuf(index)) {
/* So many deletes are performed on an insert buffer tree
that we do not consider a hash index useful on it: */
......
......@@ -1698,7 +1698,7 @@ dict_index_build_internal_clust(
new_index->trx_id_offset = 0;
if (!(index->type & DICT_IBUF)) {
if (!dict_index_is_ibuf(index)) {
/* Add system columns, trx id first */
trx_id_pos = new_index->n_def;
......@@ -1784,7 +1784,7 @@ dict_index_build_internal_clust(
mem_free(indexed);
ut_ad((index->type & DICT_IBUF)
ut_ad(dict_index_is_ibuf(index)
|| (UT_LIST_GET_LEN(table->indexes) == 0));
new_index->cached = TRUE;
......
......@@ -537,6 +537,16 @@ dict_index_is_unique(
zero for other indexes */
const dict_index_t* index) /* in: index */
__attribute__((pure));
/************************************************************************
Check whether the index is the insert buffer tree. */
UNIV_INLINE
ulint
dict_index_is_ibuf(
/*===============*/
/* out: nonzero for insert buffer,
zero for other indexes */
const dict_index_t* index) /* in: index */
__attribute__((pure));
/************************************************************************
Gets the number of user-defined columns in a table in the dictionary
......
......@@ -203,6 +203,22 @@ dict_index_is_unique(
return(UNIV_UNLIKELY(index->type & DICT_UNIQUE));
}
/************************************************************************
Check whether the index is the insert buffer tree. */
UNIV_INLINE
ulint
dict_index_is_ibuf(
/*===============*/
/* out: nonzero for insert buffer,
zero for other indexes */
const dict_index_t* index) /* in: index */
{
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(UNIV_UNLIKELY(index->type & DICT_IBUF));
}
/************************************************************************
Gets the number of user-defined columns in a table in the dictionary
cache. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment