diff options
author | Marko Mäkelä <marko.makela@oracle.com> | 2012-05-15 15:11:34 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@oracle.com> | 2012-05-15 15:11:34 +0300 |
commit | c539dab86522407a0fb494f01175ca1133970ca9 (patch) | |
tree | b6bc86f3a1cf3964c70d2bfe5d64842667d5e5b5 /storage | |
parent | 22e4b62e03da4290f0a40739914e4d0257990d50 (diff) | |
parent | dde1b32d9e292255d09dbbe15145b346fbc208f6 (diff) | |
download | mariadb-git-c539dab86522407a0fb494f01175ca1133970ca9.tar.gz |
Merge mysql-5.1 to mysql-5.5.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/dict/dict0dict.c | 22 | ||||
-rw-r--r-- | storage/innobase/row/row0ins.c | 6 |
2 files changed, 24 insertions, 4 deletions
diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c index 5be94a10374..a59401e8edf 100644 --- a/storage/innobase/dict/dict0dict.c +++ b/storage/innobase/dict/dict0dict.c @@ -4940,6 +4940,28 @@ dict_table_replace_index_in_foreign_list( 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; + } + } } /**********************************************************************//** diff --git a/storage/innobase/row/row0ins.c b/storage/innobase/row/row0ins.c index 2b77c6f929d..60a66ea3945 100644 --- a/storage/innobase/row/row0ins.c +++ b/storage/innobase/row/row0ins.c @@ -1281,7 +1281,8 @@ run_again: 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) { FILE* ef = dict_foreign_err_file; @@ -1316,9 +1317,6 @@ run_again: goto exit_func; } - ut_a(check_table); - ut_a(check_index); - if (check_table != table) { /* We already have a LOCK_IX on table, but not necessarily on check_table */ |