Commit a6da754a authored by Marko Mäkelä's avatar Marko Mäkelä

Merge mysql-5.1 to mysql-5.5.

parents bef6c0c1 5917c58a
...@@ -4940,6 +4940,28 @@ dict_table_replace_index_in_foreign_list( ...@@ -4940,6 +4940,28 @@ dict_table_replace_index_in_foreign_list(
foreign->foreign_index = new_index; foreign->foreign_index = new_index;
} }
} }
for (foreign = UT_LIST_GET_FIRST(table->referenced_list);
foreign;
foreign = UT_LIST_GET_NEXT(referenced_list, foreign)) {
dict_index_t* new_index;
if (foreign->referenced_index == index) {
ut_ad(foreign->referenced_table == index->table);
new_index = dict_foreign_find_index(
foreign->referenced_table,
foreign->referenced_col_names,
foreign->n_fields, index,
/*check_charsets=*/TRUE, /*check_null=*/FALSE);
ut_ad(new_index || !trx->check_foreigns);
ut_ad(!new_index || new_index->table == index->table);
foreign->referenced_index = new_index;
}
}
} }
/**********************************************************************//** /**********************************************************************//**
......
...@@ -1281,7 +1281,8 @@ run_again: ...@@ -1281,7 +1281,8 @@ run_again:
check_index = foreign->foreign_index; check_index = foreign->foreign_index;
} }
if (check_table == NULL || check_table->ibd_file_missing) { if (check_table == NULL || check_table->ibd_file_missing
|| check_index == NULL) {
if (check_ref) { if (check_ref) {
FILE* ef = dict_foreign_err_file; FILE* ef = dict_foreign_err_file;
...@@ -1316,9 +1317,6 @@ run_again: ...@@ -1316,9 +1317,6 @@ run_again:
goto exit_func; goto exit_func;
} }
ut_a(check_table);
ut_a(check_index);
if (check_table != table) { if (check_table != table) {
/* We already have a LOCK_IX on table, but not necessarily /* We already have a LOCK_IX on table, but not necessarily
on check_table */ on check_table */
......
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