OLD | NEW |
1 # 2014-12-19 | 1 # 2014-12-19 |
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 #*********************************************************************** |
11 # This file implements regression tests for SQLite library. | 11 # This file implements regression tests for SQLite library. |
12 # | 12 # |
13 # This file implements tests for PRAGMA data_version command. | 13 # This file implements tests for PRAGMA data_version command. |
14 # | 14 # |
15 | 15 |
16 set testdir [file dirname $argv0] | 16 set testdir [file dirname $argv0] |
17 source $testdir/tester.tcl | 17 source $testdir/tester.tcl |
| 18 do_not_use_codec |
18 | 19 |
19 do_execsql_test pragma3-100 { | 20 do_execsql_test pragma3-100 { |
20 PRAGMA data_version; | 21 PRAGMA data_version; |
21 } {1} | 22 } {1} |
22 do_execsql_test pragma3-101 { | 23 do_execsql_test pragma3-101 { |
23 PRAGMA temp.data_version; | 24 PRAGMA temp.data_version; |
24 } {1} | 25 } {1} |
25 | 26 |
26 # Writing to the pragma is a no-op | 27 # Writing to the pragma is a no-op |
27 do_execsql_test pragma3-102 { | 28 do_execsql_test pragma3-102 { |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 db2 close | 214 db2 close |
214 db close | 215 db close |
215 sqlite3_enable_shared_cache $::enable_shared_cache | 216 sqlite3_enable_shared_cache $::enable_shared_cache |
216 } | 217 } |
217 | 218 |
218 # Make sure this also works in WAL mode | 219 # Make sure this also works in WAL mode |
219 # | 220 # |
220 # This will not work with the in-memory journal permutation, as opening | 221 # This will not work with the in-memory journal permutation, as opening |
221 # [db2] switches the journal mode back to "memory" | 222 # [db2] switches the journal mode back to "memory" |
222 # | 223 # |
223 ifcapable wal { | 224 if {[wal_is_capable]} { |
224 if {[permutation]!="inmemory_journal"} { | 225 if {[permutation]!="inmemory_journal"} { |
225 | 226 |
226 sqlite3 db test.db | 227 sqlite3 db test.db |
227 db eval {PRAGMA journal_mode=WAL} | 228 db eval {PRAGMA journal_mode=WAL} |
228 sqlite3 db2 test.db | 229 sqlite3 db2 test.db |
229 do_test pragma3-400 { | 230 do_test pragma3-400 { |
230 db eval { | 231 db eval { |
231 PRAGMA data_version; | 232 PRAGMA data_version; |
232 PRAGMA journal_mode; | 233 PRAGMA journal_mode; |
233 SELECT * FROM t1; | 234 SELECT * FROM t1; |
(...skipping 10 matching lines...) Expand all Loading... |
244 db eval {UPDATE t1 SET a=111*(a/100); PRAGMA data_version; SELECT * FROM t1} | 245 db eval {UPDATE t1 SET a=111*(a/100); PRAGMA data_version; SELECT * FROM t1} |
245 } {2 111 222} | 246 } {2 111 222} |
246 do_test pragma3-430 { | 247 do_test pragma3-430 { |
247 db2 eval {PRAGMA data_version; SELECT * FROM t1;} | 248 db2 eval {PRAGMA data_version; SELECT * FROM t1;} |
248 } {3 111 222} | 249 } {3 111 222} |
249 db2 close | 250 db2 close |
250 } | 251 } |
251 } | 252 } |
252 | 253 |
253 finish_test | 254 finish_test |
OLD | NEW |