db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dag H. Wanvik (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-6527) Fix errors in foreign keys documentation
Date Tue, 06 May 2014 22:28:17 GMT

    [ https://issues.apache.org/jira/browse/DERBY-6527?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13991251#comment-13991251

Dag H. Wanvik commented on DERBY-6527:

Running the script below:
connect 'jdbc:derby:memory:wombat;create=true';
autocommit off;
create table t(i int primary key);
create table t2(i int unique, constraint c1 foreign key(i) references t(i) on delete set null);
create table t3(i int, constraint c2 foreign key(i) references t2(i) on update no action /*
or RESTRICT */ );
insert into t values 1;
insert into t2 values 1;
insert into t3 values 1;
delete from t;
gave this error on the delete:
ERROR 23503: UPDATE on table 'T2' caused a violation of foreign key constraint 'C2' for key
(1).  The statement has been rolled back.
so, it seems this can't happen:
(Again, if the dependent table also has dependent tables,
 nullable columns in those tables' foreign keys are also set to null.) 

> Fix errors in foreign keys documentation
> ----------------------------------------
>                 Key: DERBY-6527
>                 URL: https://issues.apache.org/jira/browse/DERBY-6527
>             Project: Derby
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions:
>            Reporter: Dag H. Wanvik
>            Assignee: Kim Haase
> Cf this email thread: http://apache-database.10148.n7.nabble.com/Foreign-key-semantics-as-documented-td138227.html
> Our documentation in the reference manual on foreign keys/referential actions has errors.

This message was sent by Atlassian JIRA

View raw message