On , Pavel Ivanov <paiva...@gmail.com> wrote:

> Hi, Richard!
>
> Could you explain why this scenario doesn't cause infinite call cycle
> of the trigger by itself? Is there some protection in SQLite which
> breaks such cycles?
>

Many dbms forbid recursive trigger calls that modify a table that has been 
previous modified by the same chain of trigger invocations.
For example:
  table A, trigger Y which modifies B
  table B, trigger W which modifies A

DML on A invokes Y which modifies B, and in turn invokes W which tries to 
modify A. This could cause infinite recursion. So it should not be allowed.

The only thing that triggers are allowed to do is to change only the line that 
causes the invocation of the trigger, if it is a FOR EACH ROW trigger, or 
change other tables if that does not cause recursion back to the original one.

I don't know how sqlite handles these situations, but they should be forbidden.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to