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(
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
the index entry uniquely */
......@@ -1696,7 +1696,7 @@ dict_index_build_internal_clust(
# error "DATA_ROLL_PTR != 2"
#endif
if (!(index->type & DICT_UNIQUE)) {
if (!dict_index_is_unique(index)) {
dict_index_add_col(new_index, table,
dict_table_get_sys_col(
table, DATA_ROW_ID),
......@@ -1855,7 +1855,7 @@ dict_index_build_internal_non_clust(
mem_free(indexed);
if ((index->type) & DICT_UNIQUE) {
if (dict_index_is_unique(index)) {
new_index->n_uniq = index->n_fields;
} else {
new_index->n_uniq = new_index->n_def;
......@@ -4171,9 +4171,9 @@ dict_index_print_low(
n_vals = index->stat_n_diff_key_vals[1];
}
if (index->type & DICT_CLUSTERED) {
if (dict_index_is_clust(index)) {
type_string = "clustered index";
} else if (index->type & DICT_UNIQUE) {
} else if (dict_index_is_unique(index)) {
type_string = "unique index";
} else {
type_string = "secondary index";
......
......@@ -89,7 +89,7 @@ ibuf_should_try(
decide */
{
if (!dict_index_is_clust(index)
&& (ignore_sec_unique || !(index->type & DICT_UNIQUE))) {
&& (ignore_sec_unique || !dict_index_is_unique(index))) {
ibuf_flush_count++;
......
......@@ -1813,7 +1813,7 @@ row_ins_duplicate_error_in_clust(
UT_NOT_USED(mtr);
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
of delete marked records with the same value for the non-clustered
......@@ -2052,8 +2052,8 @@ row_ins_index_entry_low(
n_unique = dict_index_get_n_unique(index);
if (index->type & DICT_UNIQUE && (cursor.up_match >= n_unique
|| cursor.low_match >= n_unique)) {
if (dict_index_is_unique(index) && (cursor.up_match >= n_unique
|| cursor.low_match >= n_unique)) {
if (dict_index_is_clust(index)) {
/* Note that the following may return also
......@@ -2291,7 +2291,7 @@ row_ins_alloc_row_id_step(
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 */
......
......@@ -4200,7 +4200,7 @@ row_scan_and_check_index(
rec_print_new(stderr, rec, offsets);
putc('\n', stderr);
is_ok = FALSE;
} else if ((index->type & DICT_UNIQUE)
} else if (dict_index_is_unique(index)
&& !contains_null
&& matched_fields
>= dict_index_get_n_ordering_defined_by_user(
......
......@@ -3462,7 +3462,7 @@ row_search_for_mysql(
locks when locking delete-marked records. */
if (match_mode == ROW_SEL_EXACT
&& index->type & DICT_UNIQUE
&& dict_index_is_unique(index)
&& dtuple_get_n_fields(search_tuple)
== dict_index_get_n_unique(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