-----Message d'origine-----
De : Tonu Samuel [mailto:[EMAIL PROTECTED]]
Envoye : mercredi 12 juin 2002 10:51
A : Christophe BRAM
Cc : [EMAIL PROTECTED]
Objet : Re: Foreign key integrity pb ?




On Wed, 12 Jun 2002, Christophe BRAM wrote:

> I'm using MySQL Max 4.0.1
>
> ----
> CREATE TABLE TableTwo
> (
>       Id              int NOT NULL auto_increment,
>       FK_TableOne     int NOT NULL REFERENCES TableOne(Id),
>
>       PRIMARY KEY (Id)
> ) TYPE=InnoDB;
> ----
>
> --> How can this work without having beforehand created the table
"TableOne"
> ???
>
> Normally it should result in an error, shouldn't it ?


MySQL does not use or check REFERENCES in any way. It just ignores them.
MySQL does not give error on REFERENCES because compatibility but it still
do nothing with this knowledge. References is one thing MySQL does not
want to do as it reduces speed of DB.

  Tonu


But then why is it said that foreign keys are a MySQL feature ?
http://www.mysql.com/doc/e/x/example-Foreign_keys.html


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to