Commit 7660d8c9 authored by Marko Mäkelä's avatar Marko Mäkelä

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.)
parent 609d0a91
...@@ -4324,7 +4324,7 @@ btr_discard_only_page_on_level( ...@@ -4324,7 +4324,7 @@ btr_discard_only_page_on_level(
/* btr_page_empty() is supposed to zero-initialize the field. */ /* btr_page_empty() is supposed to zero-initialize the field. */
ut_ad(!page_get_instant(block->frame)); ut_ad(!page_get_instant(block->frame));
if (index->is_clust()) { if (index->is_primary()) {
/* Concurrent access is prevented by the root_block->lock /* Concurrent access is prevented by the root_block->lock
X-latch, so this should be safe. */ X-latch, so this should be safe. */
index->remove_instant(); index->remove_instant();
......
...@@ -404,7 +404,7 @@ static ...@@ -404,7 +404,7 @@ static
dberr_t dberr_t
btr_cur_instant_init_low(dict_index_t* index, mtr_t* mtr) 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->n_core_null_bytes == dict_index_t::NO_CORE_NULL_BYTES);
ut_ad(index->table->supports_instant()); ut_ad(index->table->supports_instant());
ut_ad(index->table->is_readable()); ut_ad(index->table->is_readable());
...@@ -554,7 +554,7 @@ btr_cur_instant_root_init(dict_index_t* index, const page_t* page) ...@@ -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_root(page));
ut_ad(!page_is_comp(page) == !dict_table_is_comp(index->table)); 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->is_instant());
ut_ad(index->table->supports_instant()); ut_ad(index->table->supports_instant());
/* This is normally executed as part of btr_cur_instant_init() /* This is normally executed as part of btr_cur_instant_init()
...@@ -5363,7 +5363,7 @@ btr_cur_optimistic_delete_func( ...@@ -5363,7 +5363,7 @@ btr_cur_optimistic_delete_func(
index->is_instant() will hold until the index->is_instant() will hold until the
insert into SYS_COLUMNS is rolled back. */ insert into SYS_COLUMNS is rolled back. */
ut_ad(index->table->supports_instant()); ut_ad(index->table->supports_instant());
ut_ad(index->is_clust()); ut_ad(index->is_primary());
} else { } else {
lock_update_delete(block, rec); lock_update_delete(block, rec);
} }
...@@ -5371,7 +5371,7 @@ btr_cur_optimistic_delete_func( ...@@ -5371,7 +5371,7 @@ btr_cur_optimistic_delete_func(
index, 0, mtr); index, 0, mtr);
page_cur_set_after_last(block, btr_cur_get_page_cur(cursor)); 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 /* Concurrent access is prevented by
root_block->lock X-latch, so this should be root_block->lock X-latch, so this should be
safe. */ safe. */
...@@ -5400,7 +5400,7 @@ btr_cur_optimistic_delete_func( ...@@ -5400,7 +5400,7 @@ btr_cur_optimistic_delete_func(
index->is_instant() will hold until the index->is_instant() will hold until the
insert into SYS_COLUMNS is rolled back. */ insert into SYS_COLUMNS is rolled back. */
ut_ad(cursor->index->table->supports_instant()); ut_ad(cursor->index->table->supports_instant());
ut_ad(cursor->index->is_clust()); ut_ad(cursor->index->is_primary());
ut_ad(!page_zip); ut_ad(!page_zip);
page_cur_delete_rec(btr_cur_get_page_cur(cursor), page_cur_delete_rec(btr_cur_get_page_cur(cursor),
cursor->index, offsets, mtr); cursor->index, offsets, mtr);
...@@ -5567,7 +5567,7 @@ btr_cur_pessimistic_delete( ...@@ -5567,7 +5567,7 @@ btr_cur_pessimistic_delete(
insert into SYS_COLUMNS is rolled back. */ insert into SYS_COLUMNS is rolled back. */
ut_ad(rollback); ut_ad(rollback);
ut_ad(index->table->supports_instant()); ut_ad(index->table->supports_instant());
ut_ad(index->is_clust()); ut_ad(index->is_primary());
} else if (flags == 0) { } else if (flags == 0) {
lock_update_delete(block, rec); lock_update_delete(block, rec);
} }
...@@ -5593,7 +5593,7 @@ btr_cur_pessimistic_delete( ...@@ -5593,7 +5593,7 @@ btr_cur_pessimistic_delete(
btr_page_empty(block, page_zip, index, 0, mtr); btr_page_empty(block, page_zip, index, 0, mtr);
page_cur_set_after_last(block, page_cur_set_after_last(block,
btr_cur_get_page_cur(cursor)); btr_cur_get_page_cur(cursor));
if (index->is_clust()) { if (index->is_primary()) {
/* Concurrent access is prevented by /* Concurrent access is prevented by
index->lock and root_block->lock index->lock and root_block->lock
X-latch, so this should be safe. */ X-latch, so this should be safe. */
......
...@@ -1199,8 +1199,8 @@ dict_mem_table_is_system( ...@@ -1199,8 +1199,8 @@ dict_mem_table_is_system(
@param[in] clustered index definition after instant ADD COLUMN */ @param[in] clustered index definition after instant ADD COLUMN */
inline void dict_index_t::instant_add_field(const dict_index_t& instant) inline void dict_index_t::instant_add_field(const dict_index_t& instant)
{ {
DBUG_ASSERT(is_clust()); DBUG_ASSERT(is_primary());
DBUG_ASSERT(instant.is_clust()); DBUG_ASSERT(instant.is_primary());
DBUG_ASSERT(!instant.is_instant()); DBUG_ASSERT(!instant.is_instant());
DBUG_ASSERT(n_def == n_fields); DBUG_ASSERT(n_def == n_fields);
DBUG_ASSERT(instant.n_def == instant.n_fields); DBUG_ASSERT(instant.n_def == instant.n_fields);
...@@ -1485,7 +1485,7 @@ dict_index_t::vers_history_row( ...@@ -1485,7 +1485,7 @@ dict_index_t::vers_history_row(
const rec_t* rec, const rec_t* rec,
const ulint* offsets) const ulint* offsets)
{ {
ut_a(is_clust()); ut_ad(is_primary());
ulint len; ulint len;
dict_col_t& col= table->cols[table->vers_end]; dict_col_t& col= table->cols[table->vers_end];
...@@ -1513,7 +1513,7 @@ dict_index_t::vers_history_row( ...@@ -1513,7 +1513,7 @@ dict_index_t::vers_history_row(
const rec_t* rec, const rec_t* rec,
bool &history_row) bool &history_row)
{ {
ut_ad(!is_clust()); ut_ad(!is_primary());
bool error = false; bool error = false;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
......
...@@ -286,7 +286,7 @@ dict_index_is_clust( ...@@ -286,7 +286,7 @@ dict_index_is_clust(
const dict_index_t* index) /*!< in: index */ const dict_index_t* index) /*!< in: index */
{ {
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); 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. /** Check if index is auto-generated clustered index.
......
...@@ -1080,8 +1080,6 @@ struct dict_index_t{ ...@@ -1080,8 +1080,6 @@ struct dict_index_t{
/** @return whether instant ADD COLUMN is in effect */ /** @return whether instant ADD COLUMN is in effect */
inline bool is_instant() const; 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 /** @return whether the index is the primary key index
(not the clustered index of the change buffer) */ (not the clustered index of the change buffer) */
bool is_primary() const bool is_primary() const
...@@ -1129,7 +1127,7 @@ struct dict_index_t{ ...@@ -1129,7 +1127,7 @@ struct dict_index_t{
Protected by index root page x-latch or table X-lock. */ Protected by index root page x-latch or table X-lock. */
void remove_instant() void remove_instant()
{ {
DBUG_ASSERT(is_clust()); DBUG_ASSERT(is_primary());
if (!is_instant()) { if (!is_instant()) {
return; return;
} }
......
...@@ -449,7 +449,7 @@ lock_sec_rec_cons_read_sees( ...@@ -449,7 +449,7 @@ lock_sec_rec_cons_read_sees(
const ReadView* view) /*!< in: consistent read view */ const ReadView* view) /*!< in: consistent read view */
{ {
ut_ad(page_rec_is_user_rec(rec)); 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)); ut_ad(!rec_is_default_row(rec, index));
/* NOTE that we might call this function while holding the search /* NOTE that we might call this function while holding the search
......
...@@ -1742,7 +1742,7 @@ row_ins_check_foreign_constraint( ...@@ -1742,7 +1742,7 @@ row_ins_check_foreign_constraint(
if (check_table->versioned()) { if (check_table->versioned()) {
bool history_row = false; bool history_row = false;
if (check_index->is_clust()) { if (check_index->is_primary()) {
history_row = check_index-> history_row = check_index->
vers_history_row(rec, offsets); vers_history_row(rec, offsets);
} else if (check_index-> } else if (check_index->
...@@ -3370,7 +3370,7 @@ row_ins_index_entry( ...@@ -3370,7 +3370,7 @@ row_ins_index_entry(
DBUG_SET("-d,row_ins_index_entry_timeout"); DBUG_SET("-d,row_ins_index_entry_timeout");
return(DB_LOCK_WAIT);}); return(DB_LOCK_WAIT);});
if (index->is_clust()) { if (index->is_primary()) {
return(row_ins_clust_index_entry(index, entry, thr, 0, false)); return(row_ins_clust_index_entry(index, entry, thr, 0, false));
} else { } else {
return(row_ins_sec_index_entry(index, entry, thr, false)); return(row_ins_sec_index_entry(index, entry, thr, false));
......
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