summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 5aba764e293..84f51a95691 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -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;