-
Mattias Jonsson authored
NEEDS CREATE_INFO WHEN CALLED FROM MYSQLD. Problem was that the logic in mysql_alter_table() assumed foreign keys was not allowed for any ALTER TABLE ... PARTITION commands, which forced ha_ndbcluster to workaround this. Solution is to only fix the logic in mysql_alter_table() by only using can_switch_engines() as 'is this table referenced or have references from/to foreign keys.' And for ALTER TABLE ... PARTITION commands, check if the original engine does not support partitioning and there exists foreign keys for the table, then return error, since it will use the ha_partition engine which does not support foreign keys. This simplifies ha_ndbcluster::can_switch_engines() to only check is_child_or_parent_of_fk().
Mattias Jonsson authoredNEEDS CREATE_INFO WHEN CALLED FROM MYSQLD. Problem was that the logic in mysql_alter_table() assumed foreign keys was not allowed for any ALTER TABLE ... PARTITION commands, which forced ha_ndbcluster to workaround this. Solution is to only fix the logic in mysql_alter_table() by only using can_switch_engines() as 'is this table referenced or have references from/to foreign keys.' And for ALTER TABLE ... PARTITION commands, check if the original engine does not support partitioning and there exists foreign keys for the table, then return error, since it will use the ha_partition engine which does not support foreign keys. This simplifies ha_ndbcluster::can_switch_engines() to only check is_child_or_parent_of_fk().
Loading