Commit a2944816 authored by marko's avatar marko

branches/zip: Make use of the function dict_index_is_unique().

parent 39dc9f71
...@@ -1669,7 +1669,7 @@ dict_index_build_internal_clust( ...@@ -1669,7 +1669,7 @@ dict_index_build_internal_clust(
new_index->n_uniq = REC_MAX_N_FIELDS; new_index->n_uniq = REC_MAX_N_FIELDS;
} else if (index->type & DICT_UNIQUE) { } else if (dict_index_is_unique(index)) {
/* Only the fields defined so far are needed to identify /* Only the fields defined so far are needed to identify
the index entry uniquely */ the index entry uniquely */
...@@ -1696,7 +1696,7 @@ dict_index_build_internal_clust( ...@@ -1696,7 +1696,7 @@ dict_index_build_internal_clust(
# error "DATA_ROLL_PTR != 2" # error "DATA_ROLL_PTR != 2"
#endif #endif
if (!(index->type & DICT_UNIQUE)) { if (!dict_index_is_unique(index)) {
dict_index_add_col(new_index, table, dict_index_add_col(new_index, table,
dict_table_get_sys_col( dict_table_get_sys_col(
table, DATA_ROW_ID), table, DATA_ROW_ID),
...@@ -1855,7 +1855,7 @@ dict_index_build_internal_non_clust( ...@@ -1855,7 +1855,7 @@ dict_index_build_internal_non_clust(
mem_free(indexed); mem_free(indexed);
if ((index->type) & DICT_UNIQUE) { if (dict_index_is_unique(index)) {
new_index->n_uniq = index->n_fields; new_index->n_uniq = index->n_fields;
} else { } else {
new_index->n_uniq = new_index->n_def; new_index->n_uniq = new_index->n_def;
...@@ -4171,9 +4171,9 @@ dict_index_print_low( ...@@ -4171,9 +4171,9 @@ dict_index_print_low(
n_vals = index->stat_n_diff_key_vals[1]; n_vals = index->stat_n_diff_key_vals[1];
} }
if (index->type & DICT_CLUSTERED) { if (dict_index_is_clust(index)) {
type_string = "clustered index"; type_string = "clustered index";
} else if (index->type & DICT_UNIQUE) { } else if (dict_index_is_unique(index)) {
type_string = "unique index"; type_string = "unique index";
} else { } else {
type_string = "secondary index"; type_string = "secondary index";
......
...@@ -89,7 +89,7 @@ ibuf_should_try( ...@@ -89,7 +89,7 @@ ibuf_should_try(
decide */ decide */
{ {
if (!dict_index_is_clust(index) if (!dict_index_is_clust(index)
&& (ignore_sec_unique || !(index->type & DICT_UNIQUE))) { && (ignore_sec_unique || !dict_index_is_unique(index))) {
ibuf_flush_count++; ibuf_flush_count++;
......
...@@ -1813,7 +1813,7 @@ row_ins_duplicate_error_in_clust( ...@@ -1813,7 +1813,7 @@ row_ins_duplicate_error_in_clust(
UT_NOT_USED(mtr); UT_NOT_USED(mtr);
ut_a(dict_index_is_clust(cursor->index)); ut_a(dict_index_is_clust(cursor->index));
ut_ad(cursor->index->type & DICT_UNIQUE); ut_ad(dict_index_is_unique(cursor->index));
/* NOTE: For unique non-clustered indexes there may be any number /* NOTE: For unique non-clustered indexes there may be any number
of delete marked records with the same value for the non-clustered of delete marked records with the same value for the non-clustered
...@@ -2052,8 +2052,8 @@ row_ins_index_entry_low( ...@@ -2052,8 +2052,8 @@ row_ins_index_entry_low(
n_unique = dict_index_get_n_unique(index); n_unique = dict_index_get_n_unique(index);
if (index->type & DICT_UNIQUE && (cursor.up_match >= n_unique if (dict_index_is_unique(index) && (cursor.up_match >= n_unique
|| cursor.low_match >= n_unique)) { || cursor.low_match >= n_unique)) {
if (dict_index_is_clust(index)) { if (dict_index_is_clust(index)) {
/* Note that the following may return also /* Note that the following may return also
...@@ -2291,7 +2291,7 @@ row_ins_alloc_row_id_step( ...@@ -2291,7 +2291,7 @@ row_ins_alloc_row_id_step(
ut_ad(node->state == INS_NODE_ALLOC_ROW_ID); ut_ad(node->state == INS_NODE_ALLOC_ROW_ID);
if (dict_table_get_first_index(node->table)->type & DICT_UNIQUE) { if (dict_index_is_unique(dict_table_get_first_index(node->table))) {
/* No row id is stored if the clustered index is unique */ /* No row id is stored if the clustered index is unique */
......
...@@ -4200,7 +4200,7 @@ not_ok: ...@@ -4200,7 +4200,7 @@ not_ok:
rec_print_new(stderr, rec, offsets); rec_print_new(stderr, rec, offsets);
putc('\n', stderr); putc('\n', stderr);
is_ok = FALSE; is_ok = FALSE;
} else if ((index->type & DICT_UNIQUE) } else if (dict_index_is_unique(index)
&& !contains_null && !contains_null
&& matched_fields && matched_fields
>= dict_index_get_n_ordering_defined_by_user( >= dict_index_get_n_ordering_defined_by_user(
......
...@@ -3462,7 +3462,7 @@ row_search_for_mysql( ...@@ -3462,7 +3462,7 @@ row_search_for_mysql(
locks when locking delete-marked records. */ locks when locking delete-marked records. */
if (match_mode == ROW_SEL_EXACT if (match_mode == ROW_SEL_EXACT
&& index->type & DICT_UNIQUE && dict_index_is_unique(index)
&& dtuple_get_n_fields(search_tuple) && dtuple_get_n_fields(search_tuple)
== dict_index_get_n_unique(index) == dict_index_get_n_unique(index)
&& (dict_index_is_clust(index) && (dict_index_is_clust(index)
......
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