Commit 2c7e2c30 authored by marko's avatar marko

branches/zip: Clean up: do not assign index->id as a special case

in fast index creation.  In r1399, we wrote undo log records about
creating indexes.  The special undo log records were deemed
unnecessary later, but this special handling was not removed then.

row_merge_create_index(): Do not assign index->id.

dict_build_index_def_step(): Unconditionally assign index->id.
parent a3feeae4
......@@ -543,11 +543,7 @@ dict_build_index_def_step(
ut_ad((UT_LIST_GET_LEN(table->indexes) > 0)
|| dict_index_is_clust(index));
/* For fast index creation we have already allocated an index id
for this index so that we could write an UNDO log record for it.*/
if (ut_dulint_is_zero(index->id)) {
index->id = dict_hdr_get_new_id(DICT_HDR_INDEX_ID);
}
index->id = dict_hdr_get_new_id(DICT_HDR_INDEX_ID);
/* Inherit the space id from the table; we store all indexes of a
table in the same tablespace */
......
......@@ -2160,14 +2160,6 @@ row_merge_create_index(
ut_a(index);
/* Create the index id, as it will be required when we build
the index. We assign the id here because we want to write an
UNDO record before we insert the entry into SYS_INDEXES. */
ut_a(ut_dulint_is_zero(index->id));
index->id = dict_hdr_get_new_id(DICT_HDR_INDEX_ID);
index->table = table;
for (i = 0; i < n_fields; i++) {
merge_index_field_t* ifield = &index_def->fields[i];
......@@ -2175,8 +2167,7 @@ row_merge_create_index(
ifield->prefix_len);
}
/* Add the index to SYS_INDEXES, this will use the prototype
to create an entry in SYS_INDEXES. */
/* Add the index to SYS_INDEXES, using the index prototype. */
err = row_merge_create_index_graph(trx, table, index);
if (err == DB_SUCCESS) {
......
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