[
https://issues.apache.org/jira/browse/DERBY-6568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dag H. Wanvik updated DERBY-6568:
---------------------------------
Summary: Undocumented SET DEFAULT referential action for ON DELETE broken
(was: Undocumented SET DEFAULT referential action fo ON DELETE broken)
> Undocumented SET DEFAULT referential action for ON DELETE broken
> ----------------------------------------------------------------
>
> Key: DERBY-6568
> URL: https://issues.apache.org/jira/browse/DERBY-6568
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Reporter: Dag H. Wanvik
>
> Derby accepts the syntax for referential action SET DEFAULT, but it doesn't
> seem to handle it right, cf. this script
> {code}
> ij> connect 'jdbc:derby:memory:wombat;create=true';
> ij> autocommit off;
> ij> create table parent(i int , j int, constraint c1 unique(i,j));
> ij> create table child(i int default null, j int default 5, constraint c2
> foreign key(i,j) references parent(i,j) on delete set default);
> ij> insert into parent values (1,10);
> ij> insert into child values (1,10);
> ij> insert into child values (default, default);
> ij> delete from parent;
> ERROR 23503: DELETE on table 'PARENT' caused a violation of foreign key
> constraint 'C2' for key (1,10). The statement has been rolled back.
> ij> select * from child;
> I |J
> -----------------------
> 1 |10
> NULL |5
> {code}
> The delete should have succeeded since the delete action is to set the
> defaults.
--
This message was sent by Atlassian JIRA
(v6.2#6252)