Bugs item #1296395, was opened at 2005-09-20 15:31
Message generated for change (Comment added) made by romulog
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1296395&group_id=56967

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: SQL/Core
Group: (zombie: SQL 2.8.0)
Status: Open
Resolution: Accepted
Priority: 5
Private: No
Submitted By: Fabian (mr-meltdown)
Assigned to: Niels Nes (nielsnes)
Summary: SQL: ON DELETE/UPDATE CASCADE accepted but not executed

Initial Comment:
monetdb-> create table a (id int primary key);
Operation successful

monetdb-> create table b (id int, foreign key (id)
references a(id) on delete cascade);
Operation successful

monetdb-> insert into a values (1);
1 affected row

monetdb-> insert into b values(1);
1 affected row

monetdb-> delete from a;       
1 affected row

monetdb-> select * from b;
+------------+
| id         |
+============+
|          1 |
+------------+
1 row

monetdb-> 



although the ON DELETE CASCADE clause is accepted, it
is not implemented.  We better not accept this, or best
just implement it.

----------------------------------------------------------------------

Comment By: Romulo Goncalves (romulog)
Date: 2007-03-28 17:09

Message:
Logged In: YES 
user_id=1498628
Originator: NO

This bug, can be closed.

The example given by this bug is covered by the test:

sql/src/test/BugDay_2005-12-19_2.9.3/Tests/delete_cascade.SF-1296395.sql

Which now is green. :)

Regards,
Romulo

----------------------------------------------------------------------

Comment By: Fabian (mr-meltdown)
Date: 2007-01-24 11:41

Message:
Logged In: YES 
user_id=963970
Originator: YES

> My question is:
> Is this enough to close the bug or the implementation of DELETE/UPDATE
> CASCADED is needed?

No, this is not enough, because as far as I understand, "ON DELETE
CASCADE" is still accepted, but not acted upon.

----------------------------------------------------------------------

Comment By: Romulo Goncalves (romulog)
Date: 2007-01-24 11:35

Message:
Logged In: YES 
user_id=1498628
Originator: NO

well, if you now try to execute a DELETE over a primary key with foreign
keys you get an error message.
See this example. 
The tables and constraints:
create table t1(id int, name varchar(1024));
alter table t1 add constraint id_p primary key(id);

create table t2(id_f int, age int, foreign key(id_f) references t1(id));
alter table t2 add constraint age_p primary key(age);

The test:
sql>delete from t1 where id = 0;
MAPI  = [EMAIL PROTECTED]:50000
QUERY = delete from t1 where id = 0;
ERROR = !DELETE FROM: cannot delete from table 't1' there are foreign keys
depending on it, please use DELETE CASCADED!
sql>drop table t2;
sql>delete from t1 where id = 0;
[ 1     ]
sql>

The same it will implemented for updates over primary keys.

My question is:
Is this enough to close the bug or the implementation of DELETE/UPDATE
CASCADED is needed?

Regards,
Romulo

----------------------------------------------------------------------

Comment By: Romulo Goncalves (romulog)
Date: 2007-01-18 11:03

Message:
Logged In: YES 
user_id=1498628
Originator: NO

In my opinion it should be implemented.

It will take some time, but it is a nice feature for our system.

What do you think?

Regards,
Romulo



----------------------------------------------------------------------

Comment By: Fabian (mr-meltdown)
Date: 2006-06-06 21:00

Message:
Logged In: YES 
user_id=963970

Niels, shall we remove the syntactical support for this from
the parser?  (Like is done for WITH CHECK OPTION?)

----------------------------------------------------------------------

Comment By: Fabian (mr-meltdown)
Date: 2006-01-22 21:58

Message:
Logged In: YES 
user_id=963970

yes

----------------------------------------------------------------------

Comment By: Stefan Manegold (stmane)
Date: 2006-01-22 21:26

Message:
Logged In: YES 
user_id=572415

postponed until after the release, I suppose?


----------------------------------------------------------------------

Comment By: Fabian (mr-meltdown)
Date: 2006-01-15 14:46

Message:
Logged In: YES 
user_id=963970

this needs major work, postponing for now.

----------------------------------------------------------------------

Comment By: Sjoerd Mullender (sjoerd)
Date: 2005-12-19 16:55

Message:
Logged In: YES 
user_id=43607

BugDay_2005-12-19, sjoerd: TEST ADDED / FAILURE
sql/src/test/BugDay_2005-12-19_2.9.3/Tests/delete_cascade.SF-1296395.sql

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1296395&group_id=56967

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to