Bug #44279 Foreign keys: cascading delete can remove row affected by cascading update
Submitted: 15 Apr 2009 5:21 Modified: 20 Dec 2013 6:52
Reporter: Dmitry Lenev Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: General Severity:S3 (Non-critical)
Version:6.1-fk OS:Any
Assigned to: CPU Architecture:Any

[15 Apr 2009 5:21] Dmitry Lenev
Description:
Server built from mysql-6.1-fk tree running in --foreign-key-all-engines=1 mode allows cascading delete to remove rows which were affected by cascading update caused by the same statement (see how-to-repeat for details). This is against the SQL standard and should be disallowed.

How to repeat:
# Script for MySQL test suite which allows to reproduce the problem
--source include/have_falcon.inc
create table t1 (pk int primary key) engine=falcon;
create table t2 (fk1 int default 3 references t1 (pk) on delete set default,
                 fk2 int references t1 (pk) on delete cascade)
                engine=falcon;
insert into t1 values (1), (2), (3);
insert into t2 values (1, 2);
# According to the SQL standard the below statement should emit an error.
delete from t1 where pk in (1, 2);
[20 Dec 2013 6:52] Erlend Dahl
6.x project was abandoned years ago.