List:General Discussion« Previous MessageNext Message »
From:Ross Davis Date:June 6 2002 6:19pm
Subject:Re: on update problem?
View as plain text  
It would seem strange to implement one and not the other?  The help does say 
that you can use it and does keep the create options now. 

Does anyone know if this will be implemented in the next .5x release? 

Ross 

Me& writes: 

> Hi! 
> 
> don't think ON UPDATE is supported. 
> 
> The manual : http://www.innodb.com/ibman.html doesn't mention anything about
> it except : 
> 
> Starting from version 3.23.50 you can also associate the ON DELETE CASCADE
> or ON DELETE SET NULL clause with the foreign key constraint. 
> 
> EG 
> 
> 
>> 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 <mysql-thread111184@stripped>
>> To unsubscribe, e-mail
> <mysql-unsubscribe-sql-user-list=opbit.com@stripped>
>> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php 
>>
>>
> 
 
Thread
on update problem?Ross Davis6 Jun
  • Re: on update problem?Me&6 Jun
    • Re: on update problem?Ross Davis6 Jun