Lukas Eder created DERBY-6813:
---------------------------------

             Summary: Undocumented ON DELETE SET DEFAULT is parsed, accepted, 
but not enforced
                 Key: DERBY-6813
                 URL: https://issues.apache.org/jira/browse/DERBY-6813
             Project: Derby
          Issue Type: Bug
          Components: SQL
    Affects Versions: 10.11.1.1
            Reporter: Lukas Eder
            Priority: Minor


The REFERENCES clause implements almost all SQL standard actions for ON DELETE 
and ON UPDATE:
https://db.apache.org/derby/docs/10.11/ref/rrefsqlj16357.html#rrefsqlj16357

ON DELETE SET DEFAULT is not explicitly supported by Derby (although, it would 
be nice). But the Derby parser accepts it, but doesn't enforce it as can be 
seen in this script

{code}
create table "t1"("v" int not null)
create table "t2"("w" int)
alter table "t1" add constraint "pk" primary key ("v")
insert into "t1" ("v") values (1), (2)
insert into "t2" ("w") values (1)
alter table "t2" alter "w" set default 2
alter table "t2" add constraint "t2_fk" foreign key ("w") references "t1" ("v") 
on delete set default
delete from "t1" where "v" = 1 -- this fails, but it shouldn't fail
{code}




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to