1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

InnoDB: Prevent ALTER TABLE ... ENGINE=...

if there are foreign key constraints on the table. (Bug #5574)
This commit is contained in:
marko@hundin.mysql.fi
2005-04-07 12:16:41 +03:00
parent 699c35c80e
commit b5328a7dbc
4 changed files with 33 additions and 0 deletions

View File

@@ -3109,6 +3109,10 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
/* Safety fix for innodb */
if (lower_case_table_names)
my_casedn_str(files_charset_info, tmp_name);
if (new_db_type != old_db_type && !table->file->can_switch_engines()) {
my_error(ER_ROW_IS_REFERENCED, MYF(0));
goto err;
}
create_info->db_type=new_db_type;
if (!create_info->comment)
create_info->comment=table->comment;