OLD | NEW |
1 # 2010 February 18 | 1 # 2010 February 18 |
2 # | 2 # |
3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
5 # | 5 # |
6 # May you do good and not evil. | 6 # May you do good and not evil. |
7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
9 # | 9 # |
10 #*********************************************************************** | 10 #*********************************************************************** |
(...skipping 28 matching lines...) Expand all Loading... |
39 BEGIN; | 39 BEGIN; |
40 INSERT INTO t1 VALUES(1, 1); | 40 INSERT INTO t1 VALUES(1, 1); |
41 } | 41 } |
42 set sqlite_open_file_count | 42 set sqlite_open_file_count |
43 } {2} | 43 } {2} |
44 do_test stmt-1.4 { | 44 do_test stmt-1.4 { |
45 execsql { | 45 execsql { |
46 INSERT INTO t1 SELECT a+1, b+1 FROM t1; | 46 INSERT INTO t1 SELECT a+1, b+1 FROM t1; |
47 } | 47 } |
48 set sqlite_open_file_count | 48 set sqlite_open_file_count |
49 } {3} | 49 # 2016-03-04: statement-journal open deferred |
| 50 } {2} |
50 do_test stmt-1.5 { | 51 do_test stmt-1.5 { |
51 execsql COMMIT | 52 execsql COMMIT |
52 set sqlite_open_file_count | 53 set sqlite_open_file_count |
53 } {1} | 54 } {1} |
54 do_test stmt-1.6.1 { | 55 do_test stmt-1.6.1 { |
55 execsql { | 56 execsql { |
56 BEGIN; | 57 BEGIN; |
57 INSERT INTO t1 SELECT a+2, b+2 FROM t1; | 58 INSERT INTO t1 SELECT a+2, b+2 FROM t1; |
58 } | 59 } |
59 set sqlite_open_file_count | 60 set sqlite_open_file_count |
60 } {2} | 61 } {2} |
61 do_test stmt-1.6.2 { | 62 do_test stmt-1.6.2 { |
62 execsql { INSERT INTO t1 SELECT a+4, b+4 FROM t1 } | 63 execsql { INSERT INTO t1 SELECT a+4, b+4 FROM t1 } |
63 set sqlite_open_file_count | 64 set sqlite_open_file_count |
64 } {3} | 65 # 2016-03-04: statement-journal open deferred |
| 66 } {2} |
65 do_test stmt-1.7 { | 67 do_test stmt-1.7 { |
66 execsql COMMIT | 68 execsql COMMIT |
67 set sqlite_open_file_count | 69 set sqlite_open_file_count |
68 } {1} | 70 } {1} |
69 | 71 |
70 | 72 |
71 proc filecount {testname sql expected} { | 73 proc filecount {testname sql expected} { |
72 uplevel [list do_test $testname [subst -nocommand { | 74 uplevel [list do_test $testname [subst -nocommand { |
73 execsql BEGIN | 75 execsql BEGIN |
74 execsql { $sql } | 76 execsql { $sql } |
75 set ret [set sqlite_open_file_count] | 77 set ret [set sqlite_open_file_count] |
76 execsql ROLLBACK | 78 execsql ROLLBACK |
77 set ret | 79 set ret |
78 }] $expected] | 80 }] $expected] |
79 } | 81 } |
80 | 82 |
81 filecount stmt-2.1 { INSERT INTO t1 VALUES(9, 9) } 2 | 83 filecount stmt-2.1 { INSERT INTO t1 VALUES(9, 9) } 2 |
82 filecount stmt-2.2 { REPLACE INTO t1 VALUES(9, 9) } 2 | 84 filecount stmt-2.2 { REPLACE INTO t1 VALUES(9, 9) } 2 |
83 filecount stmt-2.3 { INSERT INTO t1 SELECT 9, 9 } 2 | 85 filecount stmt-2.3 { INSERT INTO t1 SELECT 9, 9 } 2 |
84 filecount stmt-2.4 { | 86 filecount stmt-2.4 { |
85 INSERT INTO t1 SELECT 9, 9; | 87 INSERT INTO t1 SELECT 9, 9; |
86 INSERT INTO t1 SELECT 10, 10; | 88 INSERT INTO t1 SELECT 10, 10; |
87 } 3 | 89 } 2 |
88 | 90 |
89 do_test stmt-2.5 { | 91 do_test stmt-2.5 { |
90 execsql { CREATE INDEX i1 ON t1(b) } | 92 execsql { CREATE INDEX i1 ON t1(b) } |
91 } {} | 93 } {} |
92 filecount stmt-2.6 { | 94 filecount stmt-2.6 { |
93 REPLACE INTO t1 VALUES(5, 5); | 95 REPLACE INTO t1 VALUES(5, 5); |
94 REPLACE INTO t1 VALUES(5, 5); | 96 REPLACE INTO t1 VALUES(5, 5); |
95 } 3 | 97 } 2 |
96 | 98 |
97 finish_test | 99 finish_test |
OLD | NEW |