Mysql: adding foreign key does not give warning/error on MyISAM tables

前端 未结 2 1796
情话喂你
情话喂你 2020-12-19 18:01

Here is a table I made:

mysql> show create table notes;
+-------+----------------------------------------------------+
| Table | Create Table                      


        
2条回答
  •  庸人自扰
    2020-12-19 18:29

    myISAM doesn't do referential integrity. it seems it is legal to add such constraints and hence no error, though the constraints won't be enforced as long as the engine is myISAM. It does store the keys created so the user can see what was intended, though.

提交回复
热议问题