Bug#32948: FKs allowed to reference partitioned table

Problem: when alter to partitioned table,
it does not see it as change of engine.

Solution: If alter includes partitioning, check if it is possible
to change engines (eg. is the table referenced by a FK)


mysql-test/r/partition_innodb.result:
  Bug#32948: FKs allowed to reference partitioned table
  test result
mysql-test/t/partition_innodb.test:
  Bug#32948: FKs allowed to reference partitioned table
  test case
sql/sql_table.cc:
  Bug#32948: FKs allowed to reference partitioned table
  
  if alter to partitioning, it is the same as changing engine.
This commit is contained in:
unknown 2007-12-06 14:43:06 +01:00
commit c3fceb409b
3 changed files with 29 additions and 1 deletions

View file

@ -5974,7 +5974,8 @@ view_err:
goto err;
new_db_type= create_info->db_type;
if (new_db_type != old_db_type &&
if ((new_db_type != old_db_type ||
alter_info->flags & ALTER_PARTITION) &&
!table->file->can_switch_engines())
{
my_error(ER_ROW_IS_REFERENCED, MYF(0));