OLD | NEW |
1 # 2007 September 10 | 1 # 2007 September 10 |
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 # | 11 # |
12 # This test attempts to deadlock SQLite in shared-cache mode. | 12 # This test attempts to deadlock SQLite in shared-cache mode. |
13 # | 13 # |
14 # | 14 # |
15 # $Id: thread002.test,v 1.9 2009/03/26 14:48:07 danielk1977 Exp $ | 15 # $Id: thread002.test,v 1.9 2009/03/26 14:48:07 danielk1977 Exp $ |
16 | 16 |
17 set testdir [file dirname $argv0] | 17 set testdir [file dirname $argv0] |
18 | 18 |
| 19 set do_not_use_codec 1 |
19 source $testdir/tester.tcl | 20 source $testdir/tester.tcl |
20 if {[run_thread_tests]==0} { finish_test ; return } | 21 if {[run_thread_tests]==0} { finish_test ; return } |
21 | 22 |
| 23 |
22 db close | 24 db close |
23 set ::enable_shared_cache [sqlite3_enable_shared_cache 1] | 25 set ::enable_shared_cache [sqlite3_enable_shared_cache 1] |
24 | 26 |
25 set ::NTHREAD 10 | 27 set ::NTHREAD 10 |
26 | 28 |
27 do_test thread002.1 { | 29 do_test thread002.1 { |
28 # Create 3 databases with identical schemas: | 30 # Create 3 databases with identical schemas: |
29 for {set ii 0} {$ii < 3} {incr ii} { | 31 for {set ii 0} {$ii < 3} {incr ii} { |
30 file delete -force test${ii}.db | 32 forcedelete test${ii}.db |
31 sqlite3 db test${ii}.db | 33 sqlite3 db test${ii}.db |
32 execsql { | 34 execsql { |
33 CREATE TABLE t1(k, v); | 35 CREATE TABLE t1(k, v); |
34 CREATE INDEX t1_i ON t1(v); | 36 CREATE INDEX t1_i ON t1(v); |
35 INSERT INTO t1(v) VALUES(1.0); | 37 INSERT INTO t1(v) VALUES(1.0); |
36 } | 38 } |
37 db close | 39 db close |
38 } | 40 } |
39 } {} | 41 } {} |
40 | 42 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 [execsql {PRAGMA integrity_check}] \ | 96 [execsql {PRAGMA integrity_check}] \ |
95 ] | 97 ] |
96 db close | 98 db close |
97 set res | 99 set res |
98 } [list [expr 1 + $::NTHREAD*100] ok] | 100 } [list [expr 1 + $::NTHREAD*100] ok] |
99 } | 101 } |
100 | 102 |
101 sqlite3_enable_shared_cache $::enable_shared_cache | 103 sqlite3_enable_shared_cache $::enable_shared_cache |
102 set sqlite_open_file_count 0 | 104 set sqlite_open_file_count 0 |
103 finish_test | 105 finish_test |
OLD | NEW |