-
Dmitry Lenev authored
Third part of fix for bug#25722927 "NEWDD FK: ALTER TABLE CHANGE COLUMN TYPE SHOULD CHECK FK CONSTRAINT" [noclose] After we have started to store information about foreign keys in the Transactional Data Dictionary it became possible to move checks of foreign key definition validity from the storage engine to SQL-layer and thus reduce code duplication and simplify SE implementation. This patch replaces usage of handler::can_switch_engines() method to find out if table participates in any foreign key with direct use of dd::Table or TABLE_SHARE objects. Since handler::can_switch_engines() method is not used for anything else in current server it was removed from SE API and few engines which implemented it. Generic error code and message which were issued when one tries to change SE for table participating in a foreign key have been replaced with new more specific ones. Existing test coverage was adjusted accordingly.
Dmitry Lenev authoredThird part of fix for bug#25722927 "NEWDD FK: ALTER TABLE CHANGE COLUMN TYPE SHOULD CHECK FK CONSTRAINT" [noclose] After we have started to store information about foreign keys in the Transactional Data Dictionary it became possible to move checks of foreign key definition validity from the storage engine to SQL-layer and thus reduce code duplication and simplify SE implementation. This patch replaces usage of handler::can_switch_engines() method to find out if table participates in any foreign key with direct use of dd::Table or TABLE_SHARE objects. Since handler::can_switch_engines() method is not used for anything else in current server it was removed from SE API and few engines which implemented it. Generic error code and message which were issued when one tries to change SE for table participating in a foreign key have been replaced with new more specific ones. Existing test coverage was adjusted accordingly.
Loading