Bugs item #1643536, was opened at 2007-01-24 14:22 Message generated for change (Comment added) made by romulog You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1643536&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: SQL CVS Head Status: Closed Resolution: Invalid Priority: 5 Private: No Submitted By: Romulo Goncalves (romulog) Assigned to: Niels Nes (nielsnes) Summary: Primary key loop Initial Comment: Dear developers, I created the following tables with some 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 id_p primary key(id_f); alter table t1 add constraint id_ff foreign key(id) references t2(id_f); As you can see we have a infinitive loop and the result is: [EMAIL PROTECTED] test]$ mclient sql>insert into t1 values(1, 'romulo'); MAPI = [EMAIL PROTECTED]:50000 QUERY = insert into t1 values(1, 'romulo'); ERROR = !SQLException:assert:INSERT INTO: FOREIGN KEY constraint 't1.id_ff' violated sql>insert into t2 values(1, 2); MAPI = [EMAIL PROTECTED]:50000 QUERY = insert into t2 values(1, 2); ERROR = !SQLException:assert:INSERT INTO: FOREIGN KEY constraint 't2.t2_id_f_fkey' violated sql> Regards, Romulo ---------------------------------------------------------------------- >Comment By: Romulo Goncalves (romulog) Date: 2007-01-24 21:36 Message: Logged In: YES user_id=1498628 Originator: YES I think you should not close this bug. You can not insert in these tables and you cannot drop them due the dependencies between them. I think we should avoid this loop. Regards, Romulo ---------------------------------------------------------------------- Comment By: Niels Nes (nielsnes) Date: 2007-01-24 21:29 Message: Logged In: YES user_id=43556 Originator: NO Although hard to input values into its perfectly correct. Maybe we do want to restrict here as then the primary/foreign key update and delete checks can become simpler in the case of cascades. For now I'm closing this as its no a bug. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1643536&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
