Commit fc3449b1 authored by Jimmy Yang's avatar Jimmy Yang

This is to fix a special case for the fix on bug #53592, where the

err_index could be not a member of the share structure or prebuilt
structure passed from MySQL. For now, we resort to the traditional
way of scanning index->table for the index number.
parent 40d60c89
......@@ -7418,6 +7418,26 @@ innobase_get_mysql_key_number_for_index(
ut_ad(table);
ut_ad(share);
/* If index does not belong to the table of share structure. Search
index->table instead */
if (index->table != ib_table
&& strcmp(index->table->name, share->table_name)) {
i = 0;
ind = dict_table_get_first_index(index->table);
while (index != ind) {
ind = dict_table_get_next_index(ind);
i++;
}
if (row_table_got_default_clust_index(index->table)) {
ut_a(i > 0);
i--;
}
return(i);
}
/* If index translation table exists, we will first check
the index through index translation table for a match. */
if (share->idx_trans_tbl.index_mapping) {
......
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