mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
InnoDB: Prevent ALTER TABLE ... ENGINE=...
if there are foreign key constraints on the table. (Bug #5574) sql/ha_innodb.cc: Add method can_switch_engines() sql/ha_innodb.h: Add method can_switch_engines() sql/handler.h: Add method can_switch_engines() sql/sql_table.cc: Check handler::can_switch_engines() before switching storage engines
This commit is contained in:
@ -450,6 +450,8 @@ public:
|
||||
virtual void append_create_info(String *packet) {}
|
||||
virtual char* get_foreign_key_create_info()
|
||||
{ return(NULL);} /* gets foreign key create string from InnoDB */
|
||||
/* used in ALTER TABLE; 1 if changing storage engine is allowed */
|
||||
virtual bool can_switch_engines() { return 1; }
|
||||
/* used in REPLACE; is > 0 if table is referred by a FOREIGN KEY */
|
||||
virtual uint referenced_by_foreign_key() { return 0;}
|
||||
virtual void init_table_handle_for_HANDLER()
|
||||
|
Reference in New Issue
Block a user