OLD | NEW |
1 # 2014 December 04 | 1 # 2014 December 04 |
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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 # been replaced. | 154 # been replaced. |
155 proc my_new_wal_hook {args} { return 0 } | 155 proc my_new_wal_hook {args} { return 0 } |
156 db wal_hook my_new_wal_hook | 156 db wal_hook my_new_wal_hook |
157 do_test 5.2 { | 157 do_test 5.2 { |
158 execsql { INSERT INTO t1 VALUES(11) } | 158 execsql { INSERT INTO t1 VALUES(11) } |
159 set ::old_wal_hook | 159 set ::old_wal_hook |
160 } {1} | 160 } {1} |
161 | 161 |
162 | 162 |
163 | 163 |
164 # EVIDENCE-OF: R-42842-27162 Note that the sqlite3_wal_autocheckpoint() | 164 # EVIDENCE-OF: R-57445-43425 Note that the sqlite3_wal_autocheckpoint() |
165 # interface and the wal_autocheckpoint pragma both invoke | 165 # interface and the wal_autocheckpoint pragma both invoke |
166 # sqlite3_wal_hook() and will those overwrite any prior | 166 # sqlite3_wal_hook() and will overwrite any prior sqlite3_wal_hook() |
167 # sqlite3_wal_hook() settings. | 167 # settings. |
168 # | 168 # |
169 set ::old_wal_hook 0 | 169 set ::old_wal_hook 0 |
170 proc my_old_wal_hook {args} { incr ::old_wal_hook ; return 0 } | 170 proc my_old_wal_hook {args} { incr ::old_wal_hook ; return 0 } |
171 db wal_hook my_old_wal_hook | 171 db wal_hook my_old_wal_hook |
172 do_test 6.1.1 { | 172 do_test 6.1.1 { |
173 execsql { INSERT INTO t1 VALUES(12) } | 173 execsql { INSERT INTO t1 VALUES(12) } |
174 set ::old_wal_hook | 174 set ::old_wal_hook |
175 } {1} | 175 } {1} |
176 do_test 6.1.2 { | 176 do_test 6.1.2 { |
177 execsql { PRAGMA wal_autocheckpoint = 1000 } | 177 execsql { PRAGMA wal_autocheckpoint = 1000 } |
(...skipping 13 matching lines...) Expand all Loading... |
191 # | 191 # |
192 # EVIDENCE-OF: R-23378-42536 The second is a copy of the database | 192 # EVIDENCE-OF: R-23378-42536 The second is a copy of the database |
193 # handle. | 193 # handle. |
194 # | 194 # |
195 # There is an assert() in the C wal-hook used by tclsqlite.c to | 195 # There is an assert() in the C wal-hook used by tclsqlite.c to |
196 # prove this. And that hook has been invoked multiple times when | 196 # prove this. And that hook has been invoked multiple times when |
197 # running this script. So consider this requirement tested as well. | 197 # running this script. So consider this requirement tested as well. |
198 # | 198 # |
199 | 199 |
200 finish_test | 200 finish_test |
OLD | NEW |