I have the following two tables

 CREATE TABLE `cfg_tags` (
  `cluster` varbinary(128) NOT NULL,
  `tag` varbinary(128) NOT NULL,
  `user` varchar(40) NOT NULL,
  PRIMARY KEY (`cluster`,`tag`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 


CREATE TABLE `cfg_cluster_info` (
  `cluster` varbinary(128) NOT NULL,
  `admin` varbinary(128) NOT NULL,
  PRIMARY KEY (`cluster`),
  CONSTRAINT `cfg_cluster_info_ibfk_1` FOREIGN KEY (`cluster`) REFERENCES 
`cfg_tags` (`cluster`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1


mysql> select * from cfg_tags;
+-----------+------+--------+
| cluster   | tag  | user   |
+-----------+------+--------+
| mycluster | tag1 | aveekm |
| mycluster | tag2 | aveekm |
+-----------+------+--------+

Now when I delete one row from this table for the cluster 'mycluster', all the 
matching rows in the table cfg_cluster_info are deleted. However this is not 
what I intended. I want that the delete cascade should take effect when "all" 
the rows in cfg_tags with 'mycluster' are deleted. Should I then remove the 
"delete cascade" condition and take care of this myself?


Thanks
Aveek




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to