1
0
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:
unknown
2005-04-07 12:16:41 +03:00
parent 0d17aea729
commit f7356d7391
4 changed files with 33 additions and 0 deletions

View File

@ -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()