Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % mysql test
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 183
- Server version: 5.1.41-3ubuntu12.6 (Ubuntu)
- Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
- mysql> \W
- Show warnings enabled.
- mysql> create table foo(foo_id int primary key) engine=InnoDB;
- Query OK, 0 rows affected (0.00 sec)
- mysql> create table bar(
- -> foo_id int references foo (foo_id)
- -> ) engine=InnoDB;
- Query OK, 0 rows affected (0.01 sec)
- mysql> show create table bar\G
- *************************** 1. row ***************************
- Table: bar
- Create Table: CREATE TABLE `bar` (
- `foo_id` int(11) DEFAULT NULL
- ) ENGINE=InnoDB DEFAULT CHARSET=latin1
- 1 row in set (0.00 sec)
- /* ^ Notice the glaring lack of foreign key constraint?!?
- * No errors, no warnings, no constraint.
- *
- * http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html
- *
- * "Furthermore, InnoDB does not recognize or support “inline REFERENCES
- * specifications” (as defined in the SQL standard) where the references are defined
- * as part of the column specification. InnoDB accepts REFERENCES clauses only when
- * specified as part of a separate FOREIGN KEY specification."
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement