diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-02-07 17:40:33 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-02-08 12:18:07 +0200 |
commit | 7660d8c94ec8c8c24e0a5eea66d55dd8d0e1c25c (patch) | |
tree | 74ed7cc5fa1974953529624e3ff35b800116c0c1 /storage | |
parent | 609d0a9194390dd0224b666bc0f822d4deaaff65 (diff) | |
download | mariadb-git-7660d8c94ec8c8c24e0a5eea66d55dd8d0e1c25c.tar.gz |
Remove dict_table_t::is_clust()
Replace all occurrences of the is_clust() method with is_primary(),
because that is what is actually meant. (Also the change buffer
tree would count as a clustered index.)
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/btr/btr0btr.cc | 2 | ||||
-rw-r--r-- | storage/innobase/btr/btr0cur.cc | 14 | ||||
-rw-r--r-- | storage/innobase/dict/dict0mem.cc | 8 | ||||
-rw-r--r-- | storage/innobase/include/dict0dict.ic | 2 | ||||
-rw-r--r-- | storage/innobase/include/dict0mem.h | 4 | ||||
-rw-r--r-- | storage/innobase/lock/lock0lock.cc | 2 | ||||
-rw-r--r-- | storage/innobase/row/row0ins.cc | 4 |
7 files changed, 17 insertions, 19 deletions
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc index 0fe807ceb00..8f8ade3f2fe 100644 --- a/storage/innobase/btr/btr0btr.cc +++ b/storage/innobase/btr/btr0btr.cc @@ -4324,7 +4324,7 @@ btr_discard_only_page_on_level( /* btr_page_empty() is supposed to zero-initialize the field. */ ut_ad(!page_get_instant(block->frame)); - if (index->is_clust()) { + if (index->is_primary()) { /* Concurrent access is prevented by the root_block->lock X-latch, so this should be safe. */ index->remove_instant(); diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index e32f49c7251..dd3869b40a9 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -404,7 +404,7 @@ static dberr_t btr_cur_instant_init_low(dict_index_t* index, mtr_t* mtr) { - ut_ad(index->is_clust()); + ut_ad(index->is_primary()); ut_ad(index->n_core_null_bytes == dict_index_t::NO_CORE_NULL_BYTES); ut_ad(index->table->supports_instant()); ut_ad(index->table->is_readable()); @@ -554,7 +554,7 @@ btr_cur_instant_root_init(dict_index_t* index, const page_t* page) { ut_ad(page_is_root(page)); ut_ad(!page_is_comp(page) == !dict_table_is_comp(index->table)); - ut_ad(index->is_clust()); + ut_ad(index->is_primary()); ut_ad(!index->is_instant()); ut_ad(index->table->supports_instant()); /* This is normally executed as part of btr_cur_instant_init() @@ -5363,7 +5363,7 @@ btr_cur_optimistic_delete_func( index->is_instant() will hold until the insert into SYS_COLUMNS is rolled back. */ ut_ad(index->table->supports_instant()); - ut_ad(index->is_clust()); + ut_ad(index->is_primary()); } else { lock_update_delete(block, rec); } @@ -5371,7 +5371,7 @@ btr_cur_optimistic_delete_func( index, 0, mtr); page_cur_set_after_last(block, btr_cur_get_page_cur(cursor)); - if (index->is_clust()) { + if (index->is_primary()) { /* Concurrent access is prevented by root_block->lock X-latch, so this should be safe. */ @@ -5400,7 +5400,7 @@ btr_cur_optimistic_delete_func( index->is_instant() will hold until the insert into SYS_COLUMNS is rolled back. */ ut_ad(cursor->index->table->supports_instant()); - ut_ad(cursor->index->is_clust()); + ut_ad(cursor->index->is_primary()); ut_ad(!page_zip); page_cur_delete_rec(btr_cur_get_page_cur(cursor), cursor->index, offsets, mtr); @@ -5567,7 +5567,7 @@ btr_cur_pessimistic_delete( insert into SYS_COLUMNS is rolled back. */ ut_ad(rollback); ut_ad(index->table->supports_instant()); - ut_ad(index->is_clust()); + ut_ad(index->is_primary()); } else if (flags == 0) { lock_update_delete(block, rec); } @@ -5593,7 +5593,7 @@ btr_cur_pessimistic_delete( btr_page_empty(block, page_zip, index, 0, mtr); page_cur_set_after_last(block, btr_cur_get_page_cur(cursor)); - if (index->is_clust()) { + if (index->is_primary()) { /* Concurrent access is prevented by index->lock and root_block->lock X-latch, so this should be safe. */ diff --git a/storage/innobase/dict/dict0mem.cc b/storage/innobase/dict/dict0mem.cc index 132e7960541..68ccf1b6f57 100644 --- a/storage/innobase/dict/dict0mem.cc +++ b/storage/innobase/dict/dict0mem.cc @@ -1199,8 +1199,8 @@ dict_mem_table_is_system( @param[in] clustered index definition after instant ADD COLUMN */ inline void dict_index_t::instant_add_field(const dict_index_t& instant) { - DBUG_ASSERT(is_clust()); - DBUG_ASSERT(instant.is_clust()); + DBUG_ASSERT(is_primary()); + DBUG_ASSERT(instant.is_primary()); DBUG_ASSERT(!instant.is_instant()); DBUG_ASSERT(n_def == n_fields); DBUG_ASSERT(instant.n_def == instant.n_fields); @@ -1485,7 +1485,7 @@ dict_index_t::vers_history_row( const rec_t* rec, const ulint* offsets) { - ut_a(is_clust()); + ut_ad(is_primary()); ulint len; dict_col_t& col= table->cols[table->vers_end]; @@ -1513,7 +1513,7 @@ dict_index_t::vers_history_row( const rec_t* rec, bool &history_row) { - ut_ad(!is_clust()); + ut_ad(!is_primary()); bool error = false; mem_heap_t* heap = NULL; diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic index 4190f8415a4..44a6d5e5bda 100644 --- a/storage/innobase/include/dict0dict.ic +++ b/storage/innobase/include/dict0dict.ic @@ -286,7 +286,7 @@ dict_index_is_clust( const dict_index_t* index) /*!< in: index */ { ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); - return(index->is_clust()); + return(index->type & DICT_CLUSTERED); } /** Check if index is auto-generated clustered index. diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h index 65989f0fcbf..527a9c301a6 100644 --- a/storage/innobase/include/dict0mem.h +++ b/storage/innobase/include/dict0mem.h @@ -1080,8 +1080,6 @@ struct dict_index_t{ /** @return whether instant ADD COLUMN is in effect */ inline bool is_instant() const; - /** @return whether the index is the clustered index */ - bool is_clust() const { return type & DICT_CLUSTERED; } /** @return whether the index is the primary key index (not the clustered index of the change buffer) */ bool is_primary() const @@ -1129,7 +1127,7 @@ struct dict_index_t{ Protected by index root page x-latch or table X-lock. */ void remove_instant() { - DBUG_ASSERT(is_clust()); + DBUG_ASSERT(is_primary()); if (!is_instant()) { return; } diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index 8e0ce5b1302..e823158acf1 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -449,7 +449,7 @@ lock_sec_rec_cons_read_sees( const ReadView* view) /*!< in: consistent read view */ { ut_ad(page_rec_is_user_rec(rec)); - ut_ad(!index->is_clust()); + ut_ad(!index->is_primary()); ut_ad(!rec_is_default_row(rec, index)); /* NOTE that we might call this function while holding the search diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc index 64ca14c8da7..f4bac326359 100644 --- a/storage/innobase/row/row0ins.cc +++ b/storage/innobase/row/row0ins.cc @@ -1742,7 +1742,7 @@ row_ins_check_foreign_constraint( if (check_table->versioned()) { bool history_row = false; - if (check_index->is_clust()) { + if (check_index->is_primary()) { history_row = check_index-> vers_history_row(rec, offsets); } else if (check_index-> @@ -3370,7 +3370,7 @@ row_ins_index_entry( DBUG_SET("-d,row_ins_index_entry_timeout"); return(DB_LOCK_WAIT);}); - if (index->is_clust()) { + if (index->is_primary()) { return(row_ins_clust_index_entry(index, entry, thr, 0, false)); } else { return(row_ins_sec_index_entry(index, entry, thr, false)); |