author | sl@SLION-WIN7.fritz.box |
Fri, 15 Jun 2012 03:10:57 +0200 | |
changeset 0 | bde4ae8d615e |
permissions | -rw-r--r-- |
sl@0 | 1 |
# 2007 Dec 12 |
sl@0 | 2 |
# |
sl@0 | 3 |
# The author disclaims copyright to this source code. In place of |
sl@0 | 4 |
# a legal notice, here is a blessing: |
sl@0 | 5 |
# |
sl@0 | 6 |
# May you do good and not evil. |
sl@0 | 7 |
# May you find forgiveness for yourself and forgive others. |
sl@0 | 8 |
# May you share freely, never taking more than you give. |
sl@0 | 9 |
# |
sl@0 | 10 |
#*********************************************************************** |
sl@0 | 11 |
# |
sl@0 | 12 |
# This file is to test that ticket #2832 has been fixed. |
sl@0 | 13 |
# |
sl@0 | 14 |
# $Id: tkt2832.test,v 1.4 2008/07/12 14:52:21 drh Exp $ |
sl@0 | 15 |
# |
sl@0 | 16 |
|
sl@0 | 17 |
set testdir [file dirname $argv0] |
sl@0 | 18 |
source $testdir/tester.tcl |
sl@0 | 19 |
|
sl@0 | 20 |
do_test tkt2832-1.1 { |
sl@0 | 21 |
execsql { |
sl@0 | 22 |
CREATE TABLE t1(a PRIMARY KEY); |
sl@0 | 23 |
INSERT INTO t1 VALUES(2); |
sl@0 | 24 |
INSERT INTO t1 VALUES(1); |
sl@0 | 25 |
INSERT INTO t1 VALUES(3); |
sl@0 | 26 |
} |
sl@0 | 27 |
} {} |
sl@0 | 28 |
do_test tkt2832-1.2 { |
sl@0 | 29 |
execsql { |
sl@0 | 30 |
UPDATE OR REPLACE t1 SET a = 1; |
sl@0 | 31 |
SELECT * FROM t1; |
sl@0 | 32 |
} |
sl@0 | 33 |
} {1} |
sl@0 | 34 |
|
sl@0 | 35 |
do_test tkt2832-2.1 { |
sl@0 | 36 |
execsql { |
sl@0 | 37 |
CREATE TABLE t2(a, b); |
sl@0 | 38 |
CREATE TRIGGER t2_t AFTER UPDATE ON t2 BEGIN |
sl@0 | 39 |
DELETE FROM t2 WHERE a = new.a + 1; |
sl@0 | 40 |
END; |
sl@0 | 41 |
INSERT INTO t2 VALUES(1, 2); |
sl@0 | 42 |
INSERT INTO t2 VALUES(2, 3); |
sl@0 | 43 |
} |
sl@0 | 44 |
} {} |
sl@0 | 45 |
do_test tkt2832-2.2 { |
sl@0 | 46 |
execsql { |
sl@0 | 47 |
UPDATE t2 SET b = 5 |
sl@0 | 48 |
} |
sl@0 | 49 |
} {} |
sl@0 | 50 |
|
sl@0 | 51 |
do_test tkt2832-3.1 { |
sl@0 | 52 |
execsql { |
sl@0 | 53 |
CREATE TABLE t3(a, b); |
sl@0 | 54 |
CREATE TRIGGER t3_t AFTER DELETE ON t3 BEGIN |
sl@0 | 55 |
DELETE FROM t3 WHERE a = old.a + 1; |
sl@0 | 56 |
END; |
sl@0 | 57 |
INSERT INTO t3 VALUES(1, 2); |
sl@0 | 58 |
INSERT INTO t3 VALUES(2, 3); |
sl@0 | 59 |
} |
sl@0 | 60 |
} {} |
sl@0 | 61 |
do_test tkt2832-3.2 { |
sl@0 | 62 |
execsql { DELETE FROM t3 WHERE 1 } |
sl@0 | 63 |
} {} |
sl@0 | 64 |
|
sl@0 | 65 |
finish_test |