Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: third_party/sqlite/src/test/triggerF.test

Issue 2751253002: [sql] Import SQLite 3.17.0. (Closed)
Patch Set: also clang on Linux i386 Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/sqlite/src/test/triggerE.test ('k') | third_party/sqlite/src/test/types2.test » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # 2017 January 4
2 #
3 # The author disclaims copyright to this source code. In place of
4 # a legal notice', here is a blessing:
5 #
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.
9 #
10 #***********************************************************************
11 #
12
13 set testdir [file dirname $argv0]
14 source $testdir/tester.tcl
15 set testprefix triggerF
16 ifcapable {!trigger} {
17 finish_test
18 return
19 }
20
21
22 foreach {tn sql log} {
23 1 { } { }
24
25 2 {
26 CREATE TRIGGER trd AFTER DELETE ON t1 BEGIN
27 INSERT INTO log VALUES(old.a || old.b || (SELECT count(*) FROM t1));
28 END;
29 } {1one2 2two1 3three1}
30
31 3 {
32 CREATE TRIGGER trd BEFORE DELETE ON t1 BEGIN
33 INSERT INTO log VALUES(old.a || old.b || (SELECT count(*) FROM t1));
34 END;
35 } {1one3 2two2 3three2}
36
37 4 {
38 CREATE TRIGGER tr1 AFTER DELETE ON t1 BEGIN
39 INSERT INTO log VALUES(old.a || old.b || (SELECT count(*) FROM t1));
40 END;
41 CREATE TRIGGER tr2 BEFORE DELETE ON t1 BEGIN
42 INSERT INTO log VALUES(old.a || old.b || (SELECT count(*) FROM t1));
43 END;
44 } {1one3 1one2 2two2 2two1 3three2 3three1}
45
46 } {
47 reset_db
48 do_execsql_test 1.$tn.0 {
49 PRAGMA recursive_triggers = on;
50 CREATE TABLE t1(a INT PRIMARY KEY, b) WITHOUT ROWID;
51 CREATE TABLE log(t);
52 }
53
54 execsql $sql
55
56 do_execsql_test 1.$tn.1 {
57 INSERT INTO t1 VALUES(1, 'one');
58 INSERT INTO t1 VALUES(2, 'two');
59 INSERT INTO t1 VALUES(3, 'three');
60
61 DELETE FROM t1 WHERE a=1;
62 INSERT OR REPLACE INTO t1 VALUES(2, 'three');
63 UPDATE OR REPLACE t1 SET a=3 WHERE a=2;
64 }
65
66 do_execsql_test 1.$tn.2 {
67 SELECT * FROM log ORDER BY rowid;
68 } $log
69 }
70
71 finish_test
72
OLDNEW
« no previous file with comments | « third_party/sqlite/src/test/triggerE.test ('k') | third_party/sqlite/src/test/types2.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698