diff options
Diffstat (limited to 'libraries/sqlite/unix/sqlite-3.5.1/test/trigger8.test')
-rw-r--r-- | libraries/sqlite/unix/sqlite-3.5.1/test/trigger8.test | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/libraries/sqlite/unix/sqlite-3.5.1/test/trigger8.test b/libraries/sqlite/unix/sqlite-3.5.1/test/trigger8.test new file mode 100644 index 0000000..b4215fb --- /dev/null +++ b/libraries/sqlite/unix/sqlite-3.5.1/test/trigger8.test | |||
@@ -0,0 +1,42 @@ | |||
1 | # 2006 February 27 | ||
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 | # This file implements regression tests for SQLite library. | ||
12 | # | ||
13 | # This file implements tests to make sure abusively large triggers | ||
14 | # (triggers with 100s or 1000s of statements) work. | ||
15 | # | ||
16 | |||
17 | set testdir [file dirname $argv0] | ||
18 | source $testdir/tester.tcl | ||
19 | ifcapable {!trigger} { | ||
20 | finish_test | ||
21 | return | ||
22 | } | ||
23 | |||
24 | |||
25 | do_test trigger8-1.1 { | ||
26 | execsql { | ||
27 | CREATE TABLE t1(x); | ||
28 | CREATE TABLE t2(y); | ||
29 | } | ||
30 | set sql "CREATE TRIGGER r10000 AFTER INSERT ON t1 BEGIN\n" | ||
31 | for {set i 0} {$i<10000} {incr i} { | ||
32 | append sql " INSERT INTO t2 VALUES($i);\n" | ||
33 | } | ||
34 | append sql "END;" | ||
35 | execsql $sql | ||
36 | execsql { | ||
37 | INSERT INTO t1 VALUES(5); | ||
38 | SELECT count(*) FROM t2; | ||
39 | } | ||
40 | } {10000} | ||
41 | |||
42 | finish_test | ||