mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fix Bug #53592 in plugin code, "crash replacing duplicates into table
after fast alter table added unique key". Look up MySQL index number should go through index translation table. rb://347, approved by Marko
This commit is contained in:
@ -1645,37 +1645,6 @@ row_table_got_default_clust_index(
|
||||
return(dict_index_get_nth_col(clust_index, 0)->mtype == DATA_SYS);
|
||||
}
|
||||
|
||||
/*********************************************************************//**
|
||||
Calculates the key number used inside MySQL for an Innobase index. We have
|
||||
to take into account if we generated a default clustered index for the table
|
||||
@return the key number used inside MySQL */
|
||||
UNIV_INTERN
|
||||
ulint
|
||||
row_get_mysql_key_number_for_index(
|
||||
/*===============================*/
|
||||
const dict_index_t* index) /*!< in: index */
|
||||
{
|
||||
const dict_index_t* ind;
|
||||
ulint i;
|
||||
|
||||
ut_a(index);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/*********************************************************************//**
|
||||
Locks the data dictionary in shared mode from modifications, for performing
|
||||
foreign key check, rollback, or other operation invisible to MySQL. */
|
||||
|
Reference in New Issue
Block a user