MySQL Forums
Forum List  »  InnoDB

Re: Strange Foreign key error
Posted by: Christophe Derenne
Date: April 13, 2016 03:08AM

Hi thanks for reply

After Delete :

select * from tbparent;
| colp1 | colp2 |
| a | 1 |

select* from tbchild;
| colch1 | colch2 | colch3 |
| 100 | a | abc |

so, 'a' is still there in tbparent , this why i didn't understood mysql error message.

And you're right, in this exemple, the foreign keys does not reference a unique key.

But there was no MySQL error when I create this FK and I can use it in another SGBDR (I've forgot R in last post)

So why Mysql allow me to create a foreign key that it can't manage ???

If MySQL does not allow this, It would not allow this type of creation.


Options: ReplyQuote

Written By
April 12, 2016 03:23PM
April 12, 2016 07:02PM
Re: Strange Foreign key error
April 13, 2016 03:08AM
April 13, 2016 08:57AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.