Foreign key allowed between InnoDB and MyISAM if "set foreign_key_checks=0"

Description

Also reporting in MySQL: https://bugs.mysql.com/bug.php?id=78255

Putting foreign keys between InnoDB and MyISAM should be disallowed at schema-change time (the create table should fail) because MyISAM doesn't support foreign keys. But it is allowed if foreign keys checks are switched off.

Inserting rows then fails with "ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails" even if values are valid

This may seem like a perverse set of circumstances, but it happens quite easily when using Django South migrations.

See also: http://nick.zoic.org/sql/mysql-foreign-keys-between-innodb-and-myisam/

Environment

linux debian jessie

Assignee

Unassigned

Reporter

Nick Moore

Labels

Components

Affects versions

Priority

Minor
Configure