db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Pendleton (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-6813) Undocumented ON DELETE SET DEFAULT is parsed, accepted, but not enforced
Date Sun, 31 May 2015 18:35:17 GMT

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

Bryan Pendleton commented on DERBY-6813:
----------------------------------------

Often, but not always, situations like this where Derby accepts a certain syntax
but doesn't implement the behavior turn out to be cases where the original
Cloudscape product actually *did* implement the behavior, but the implementation
was disabled during a time when that behavior was felt to be undesired.

If that is true in this case, it may be a relatively small project to re-enable it.

If you wanted, you could do some investigation into the source tree to see
if you can gather any clues about this theory; I'd be glad to assist with that.

The first step is to identify the part of the SQL grammar where that construction
is recognized, and then look through the Subversion history to see what you can
learn about that part of the parser's history.

> 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)

Mime
View raw message