1 # The author disclaims copyright to this source code. In place of
2 # a legal notice, here is a blessing:
4 # May you do good and not evil.
5 # May you find forgiveness for yourself and forgive others.
6 # May you share freely, never taking more than you give.
8 #***********************************************************************
10 # This file tests the triggers of views.
13 set testdir [file dirname $argv0]
14 source $testdir/tester.tcl
15 ifcapable {!trigger} {
22 do_test trigger5-1.1 {
25 a integer PRIMARY KEY NOT NULL ,
27 c int NOT NULL DEFAULT 0
29 CREATE TABLE Undo(UndoAction TEXT);
30 INSERT INTO Item VALUES (1,38205.60865,340);
31 CREATE TRIGGER trigItem_UNDO_AD AFTER DELETE ON Item FOR EACH ROW
33 INSERT INTO Undo SELECT 'INSERT INTO Item (a,b,c) VALUES ('
34 || coalesce(old.a,'NULL') || ',' || quote(old.b) || ',' || old.c || ');';
36 DELETE FROM Item WHERE a = 1;
39 } {{INSERT INTO Item (a,b,c) VALUES (1,38205.60865,340);}}
41 integrity_check trigger5-99.9