3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
10 #***********************************************************************
12 # This file is to test that ticket #2832 has been fixed.
14 # $Id: tkt2832.test,v 1.5 2009/04/07 14:14:23 danielk1977 Exp $
17 set testdir [file dirname $argv0]
18 source $testdir/tester.tcl
20 ifcapable !trigger { finish_test ; return }
24 CREATE TABLE t1(a PRIMARY KEY);
25 INSERT INTO t1 VALUES(2);
26 INSERT INTO t1 VALUES(1);
27 INSERT INTO t1 VALUES(3);
32 UPDATE OR REPLACE t1 SET a = 1;
39 CREATE TABLE t2(a, b);
40 CREATE TRIGGER t2_t AFTER UPDATE ON t2 BEGIN
41 DELETE FROM t2 WHERE a = new.a + 1;
43 INSERT INTO t2 VALUES(1, 2);
44 INSERT INTO t2 VALUES(2, 3);
55 CREATE TABLE t3(a, b);
56 CREATE TRIGGER t3_t AFTER DELETE ON t3 BEGIN
57 DELETE FROM t3 WHERE a = old.a + 1;
59 INSERT INTO t3 VALUES(1, 2);
60 INSERT INTO t3 VALUES(2, 3);
64 execsql { DELETE FROM t3 WHERE 1 }