Commit 49f19b2d authored by marko's avatar marko

Remove dict_col_t::aux, which was only used when copying an index definition

to the data dictionary cache.
parent cb19ec22
......@@ -1782,6 +1782,7 @@ dict_index_build_internal_clust(
ulint fixed_size;
ulint trx_id_pos;
ulint i;
ibool* indexed;
ut_ad(table && index);
ut_ad(index->type & DICT_CLUSTERED);
......@@ -1876,12 +1877,9 @@ dict_index_build_internal_clust(
}
/* Set auxiliary variables in table columns as undefined */
for (i = 0; i < table->n_cols; i++) {
col = dict_table_get_nth_col(table, i);
col->aux = ULINT_UNDEFINED;
}
/* Remember the table columns already contained in new_index */
indexed = mem_alloc(table->n_cols * sizeof *indexed);
memset(indexed, 0, table->n_cols * sizeof *indexed);
/* Mark with 0 the table columns already contained in new_index */
for (i = 0; i < new_index->n_def; i++) {
......@@ -1893,7 +1891,7 @@ dict_index_build_internal_clust(
if (field->prefix_len == 0) {
field->col->aux = 0;
indexed[field->col->ind] = TRUE;
}
}
......@@ -1904,11 +1902,13 @@ dict_index_build_internal_clust(
col = dict_table_get_nth_col(table, i);
ut_ad(col->type.mtype != DATA_SYS);
if (col->aux == ULINT_UNDEFINED) {
if (!indexed[col->ind]) {
dict_index_add_col(new_index, col, 0);
}
}
mem_free(indexed);
ut_ad((index->type & DICT_IBUF)
|| (UT_LIST_GET_LEN(table->indexes) == 0));
......@@ -1946,6 +1946,7 @@ dict_index_build_internal_non_clust(
dict_index_t* new_index;
dict_index_t* clust_index;
ulint i;
ibool* indexed;
ut_ad(table && index);
ut_ad(0 == (index->type & DICT_CLUSTERED));
......@@ -1976,13 +1977,9 @@ dict_index_build_internal_non_clust(
/* Copy fields from index to new_index */
dict_index_copy(new_index, index, 0, index->n_fields);
/* Set the auxiliary variables in the clust_index unique columns
as undefined */
for (i = 0; i < clust_index->n_uniq; i++) {
field = dict_index_get_nth_field(clust_index, i);
field->col->aux = ULINT_UNDEFINED;
}
/* Remember the table columns already contained in new_index */
indexed = mem_alloc(table->n_cols * sizeof *indexed);
memset(indexed, 0, table->n_cols * sizeof *indexed);
/* Mark with 0 table columns already contained in new_index */
for (i = 0; i < new_index->n_def; i++) {
......@@ -1994,7 +1991,7 @@ dict_index_build_internal_non_clust(
if (field->prefix_len == 0) {
field->col->aux = 0;
indexed[field->col->ind] = TRUE;
}
}
......@@ -2005,12 +2002,14 @@ dict_index_build_internal_non_clust(
field = dict_index_get_nth_field(clust_index, i);
if (field->col->aux == ULINT_UNDEFINED) {
if (!indexed[field->col->ind]) {
dict_index_add_col(new_index, field->col,
field->prefix_len);
}
}
mem_free(indexed);
if ((index->type) & DICT_UNIQUE) {
new_index->n_uniq = index->n_fields;
} else {
......
......@@ -132,8 +132,6 @@ struct dict_col_struct{
const char* name; /* name */
dtype_t type; /* data type */
dict_table_t* table; /* back pointer to table of this column */
ulint aux; /* this is used as an auxiliary variable
in some of the functions below */
};
/* DICT_MAX_INDEX_COL_LEN is measured in bytes and is the max index column
......
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