When I try to change the id field in the parent table below, I get the 
error: 1217 - Cannot delete a parent row; a foreign key constraint fails. 

What have I got wrong?  Shouldn't it cascade the changes that were made to 
the parent down to the child table? 

This is done with Mysql 3.23.50-max on Windows NT 

Here is the create that I am using for the test 

CREATE TABLE parent(id INT unsigned NOT NULL, PRIMARY KEY (id)) TYPE=INNODB;
create table child
(
 id int unsigned not null auto_increment
,  parent_id int unsigned not null
,  name varchar(20) null
,  primary key (id)
,  index parent_id(parent_id)
            FOREIGN KEY (parent_id) REFERENCES parent(id)
            ON UPDATE CASCADE
) TYPE=INNODB; 


Thanks in advance 

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