Bugs item #2788876, was opened at 2009-05-08 11:38
Message generated for change (Comment added) made by stmane
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2788876&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: MonetDB5 "stable"
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Bram [Cronos] (vandabr)
Assigned to: Niels Nes (nielsnes)
>Summary: SQL: Possible trigger bugs

Initial Comment:
[This is a repost of my message to the monetdb-users mailing list]

I'm experiencing some strange trigger behaviour. Not sure if I'm simply
missing something, or if I've run into a bug.

create table t1 (id serial, toggle boolean);
create table t2 (id serial, ref bigint);

insert into t1 (toggle) values (false);
insert into t1 (toggle) values (false);

create trigger updateMe
        after update on t1 referencing new row new_row
        for each row when new_row.toggle = true
                insert into t2 (ref) values (new_row.id);

update t1 set toggle = true where id = 1;

After this update statement, I would expect to see *1* row in t2.
Instead, I see two rows:

+----+-----+
| id | ref |
+====+=====+
|  1 |   1 |
|  2 |   2 |
+----+-----+

The "when" clause seems to be ignored entirely -- I can change to "when
1 = 0" and it'll still work.

If I change the trigger to

create trigger updateMe
        after update on t1 referencing new row new_row
        for each row insert into t2 (ref) values (new_row.id);

something equally odd happens. Instead of doing an insert for each
UPDATED row, it inserts a row for each row present in t1. This seems a
bit odd to me, but again, I could just be misunderstand the way this is
supposed to work. Documentation on triggers is a bit sparse I'm afraid...

Any help on this issue would be more than welcome!

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

>Comment By: Stefan Manegold (stmane)
Date: 2009-08-14 13:57

Message:
tagged subject

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

Comment By: Niels Nes (nielsnes)
Date: 2009-05-13 22:40

Message:
The when 'condition' code is missing as it seems. Implementation will take
some time.

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

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

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to