Bug #32056 referencing a not existing row as foreign key succeeded instead of failing.
Submitted: 2 Nov 2007 16:45 Modified: 8 Nov 2007 15:59
Reporter: Horst Hunger Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Falcon storage engine Severity:S2 (Serious)
Version:6.0.4 OS:Linux
Assigned to: Ann Harrison CPU Architecture:Any

[2 Nov 2007 16:45] Horst Hunger
Description:
the last insert in the attached program succeded with falcon though it usually failed. Please check if that is desired. the program:

        CREATE TABLE t1 (id INT NOT NULL, col1 char(50),
                PRIMARY KEY (id)) ENGINE=falcon;
        CREATE TABLE t2 (id INT PRIMARY KEY, f_id INT,
                INDEX par_ind (f_id), col1 char(50),
                FOREIGN KEY (f_id) REFERENCES t1(id)
                ON UPDATE CASCADE) ENGINE=falcon;

        insert into t1 values (1,'Department A');
        insert into t1 values (2,'Department B');
        insert into t1 values (3,'Department C');
        insert into t2 values (1,2,'Emp 1');
        insert into t2 values (2,3,'Emp 2');

        --error 1452
        insert into t2 values (3,4,'Emp 3');

How to repeat:
execute the attached test programm by copying it to mysql-test/t
and execute "mysql-test-run.pl bug".
[8 Nov 2007 15:07] Kevin Lewis
Ann,  This testcase worked fine for me.  But it uses ON UPDATE CASCADE, which is something I thought was not implemented yet, either in Falcon or the server.  Do you have any idea what the server does with SQL like this?
[8 Nov 2007 15:59] Kevin Lewis
Ann Harrison wrote;
    For reasons best understood by itself, MySQL
parses and ignores foreign key definitions, though
it passes them through (in text, I believe) to
the underlying engine.  Falcon ignores them.

This is the expected behavior until foreign keys
are supported.