mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
row0mysql.c:
Fix bug: if we RENAME a table, InnoDB forgot to load the foreign key constraints that reference the new table name, and forgot to check that they are compatible with the table innobase/row/row0mysql.c: Fix bug: if we RENAME a table, InnoDB forgot to load the foreign key constraints that reference the new table name, and forgot to check that they are compatible with the table
This commit is contained in:
@ -2630,6 +2630,30 @@ row_rename_table_for_mysql(
|
|||||||
ut_print_name(stderr, new_name);
|
ut_print_name(stderr, new_name);
|
||||||
fputs("\n"
|
fputs("\n"
|
||||||
"InnoDB: has or is referenced in foreign key constraints\n"
|
"InnoDB: has or is referenced in foreign key constraints\n"
|
||||||
|
"InnoDB: which are not compatible with the new table definition.\n",
|
||||||
|
stderr);
|
||||||
|
|
||||||
|
ut_a(dict_table_rename_in_cache(table,
|
||||||
|
old_name, FALSE));
|
||||||
|
|
||||||
|
trx->error_state = DB_SUCCESS;
|
||||||
|
trx_general_rollback_for_mysql(trx, FALSE,
|
||||||
|
NULL);
|
||||||
|
trx->error_state = DB_SUCCESS;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
err = dict_load_foreigns(new_name);
|
||||||
|
|
||||||
|
if (err != DB_SUCCESS) {
|
||||||
|
|
||||||
|
ut_print_timestamp(stderr);
|
||||||
|
|
||||||
|
fputs(
|
||||||
|
" InnoDB: Error: in RENAME TABLE table ",
|
||||||
|
stderr);
|
||||||
|
ut_print_name(stderr, new_name);
|
||||||
|
fputs("\n"
|
||||||
|
"InnoDB: is referenced in foreign key constraints\n"
|
||||||
"InnoDB: which are not compatible with the new table definition.\n",
|
"InnoDB: which are not compatible with the new table definition.\n",
|
||||||
stderr);
|
stderr);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user