Hello

I use Linux Red Hat 7.3 and MySQL-max version 2.23.51. I have one problem.

I created table:

CREATE TABLE Folders (
    FOLDER_ID INTEGER NOT NULL,
    FOLDER_NAME VARCHAR(50) NOT NULL,
    PARENT INTEGER NULL,
    PRIMARY KEY (FOLDER_ID),
    KEY XIE1_Folders (PARENT),
    FOREIGN KEY (PARENT) REFERENCES Folders (FOLDER_ID) ON DELETE CASCADE
) TYPE=INNODB;

And when I try to execute this statement:
INSERT INTO Folders VALUES (1, 'Main', NULL); 
I get error message: 
'ERROR 1216: Cannot add a child row: a foreign key constraint fails'. 

On Windows all is ok in this case.

Can you advise?

Thank you
Eduard

---------------------------------------------------------------------
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