OLD | NEW |
1 # 2009 April 10 | 1 # 2009 April 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 #*********************************************************************** |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 # SQLite will attempt to upgrade to an EXCLUSIVE lock, and hence invoke | 93 # SQLite will attempt to upgrade to an EXCLUSIVE lock, and hence invoke |
94 # the busy-handler. The tests here verify that the correct busy-handler | 94 # the busy-handler. The tests here verify that the correct busy-handler |
95 # function is invoked (the busy-handler associated with the database | 95 # function is invoked (the busy-handler associated with the database |
96 # connection that called sqlite3_step()). When bug #3793 existed, sometimes | 96 # connection that called sqlite3_step()). When bug #3793 existed, sometimes |
97 # the [db2] busy-handler was invoked from within the call to sqlite3_step() | 97 # the [db2] busy-handler was invoked from within the call to sqlite3_step() |
98 # associated with [db1]. | 98 # associated with [db1]. |
99 # | 99 # |
100 # Note: Before the bug was fixed, if [db2] was opened with the "-fullmutex 1" | 100 # Note: Before the bug was fixed, if [db2] was opened with the "-fullmutex 1" |
101 # option, then this test case would cause an assert() to fail. | 101 # option, then this test case would cause an assert() to fail. |
102 # | 102 # |
103 set ::busyconnection db1 | 103 ifcapable threadsafe { |
104 db1 eval {SELECT * FROM t2 ORDER BY a LIMIT 20} { | |
105 do_test tkt3793-2.[incr x] { set ::busyconnection } db1 | |
106 set ::busyconnection db2 | |
107 | |
108 db2 eval { SELECT count(*) FROM t2 } | |
109 do_test tkt3793-2.[incr x] { set ::busyconnection } db2 | |
110 set ::busyconnection db1 | 104 set ::busyconnection db1 |
| 105 db1 eval {SELECT * FROM t2 ORDER BY a LIMIT 20} { |
| 106 do_test tkt3793-2.[incr x] { set ::busyconnection } db1 |
| 107 set ::busyconnection db2 |
| 108 |
| 109 db2 eval { SELECT count(*) FROM t2 } |
| 110 do_test tkt3793-2.[incr x] { set ::busyconnection } db2 |
| 111 set ::busyconnection db1 |
| 112 } |
111 } | 113 } |
112 | 114 |
113 do_test tkt3793-3 { | 115 do_test tkt3793-3 { |
114 db1 close | 116 db1 close |
115 db2 close | 117 db2 close |
116 } {} | 118 } {} |
117 | 119 |
118 sqlite3_enable_shared_cache $::enable_shared_cache | 120 sqlite3_enable_shared_cache $::enable_shared_cache |
119 finish_test | 121 finish_test |
OLD | NEW |