| OLD | NEW |
| 1 # 2009 March 04 | 1 # 2009 March 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 list $rc $msg | 133 list $rc $msg |
| 134 } {1 {database is deadlocked}} | 134 } {1 {database is deadlocked}} |
| 135 | 135 |
| 136 # | 136 # |
| 137 # Test for slightly more complex deadlock involving three database | 137 # Test for slightly more complex deadlock involving three database |
| 138 # connections: db, db2 and db3. | 138 # connections: db, db2 and db3. |
| 139 # | 139 # |
| 140 do_test notify1-2.3.1 { | 140 do_test notify1-2.3.1 { |
| 141 db close | 141 db close |
| 142 db2 close | 142 db2 close |
| 143 file delete -force test.db test2.db test3.db | 143 forcedelete test.db test2.db test3.db |
| 144 foreach con {db db2 db3} { | 144 foreach con {db db2 db3} { |
| 145 sqlite3 $con test.db | 145 sqlite3 $con test.db |
| 146 $con eval { ATTACH 'test2.db' AS aux2 } | 146 $con eval { ATTACH 'test2.db' AS aux2 } |
| 147 $con eval { ATTACH 'test3.db' AS aux3 } | 147 $con eval { ATTACH 'test3.db' AS aux3 } |
| 148 } | 148 } |
| 149 execsql { | 149 execsql { |
| 150 CREATE TABLE main.t1(a, b); | 150 CREATE TABLE main.t1(a, b); |
| 151 CREATE TABLE aux2.t2(a, b); | 151 CREATE TABLE aux2.t2(a, b); |
| 152 CREATE TABLE aux3.t3(a, b); | 152 CREATE TABLE aux3.t3(a, b); |
| 153 } | 153 } |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 # already waiting on an unlock-notify callback, and then | 287 # already waiting on an unlock-notify callback, and then |
| 288 # the blocker that caused the SQLITE_LOCKED commits its | 288 # the blocker that caused the SQLITE_LOCKED commits its |
| 289 # transaction, the unlock-notify callback is not invoked. | 289 # transaction, the unlock-notify callback is not invoked. |
| 290 # | 290 # |
| 291 # notify1-6.4.*: Like 6.3.*, except that instead of the second blocker | 291 # notify1-6.4.*: Like 6.3.*, except that instead of the second blocker |
| 292 # committing its transaction, the first does. The | 292 # committing its transaction, the first does. The |
| 293 # unlock-notify callback is therefore invoked. | 293 # unlock-notify callback is therefore invoked. |
| 294 # | 294 # |
| 295 db close | 295 db close |
| 296 do_test notify1-6.1.1 { | 296 do_test notify1-6.1.1 { |
| 297 file delete -force test.db test2.db | 297 forcedelete test.db test2.db |
| 298 foreach conn {db db2 db3} { | 298 foreach conn {db db2 db3} { |
| 299 sqlite3 $conn test.db | 299 sqlite3 $conn test.db |
| 300 execsql { ATTACH 'test2.db' AS two } $conn | 300 execsql { ATTACH 'test2.db' AS two } $conn |
| 301 } | 301 } |
| 302 execsql { | 302 execsql { |
| 303 CREATE TABLE t1(a, b); | 303 CREATE TABLE t1(a, b); |
| 304 CREATE TABLE two.t2(a, b); | 304 CREATE TABLE two.t2(a, b); |
| 305 } | 305 } |
| 306 execsql { | 306 execsql { |
| 307 BEGIN; | 307 BEGIN; |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 } {} | 491 } {} |
| 492 do_test notify1-9.12 { | 492 do_test notify1-9.12 { |
| 493 execsql { COMMIT } db2 | 493 execsql { COMMIT } db2 |
| 494 } {} | 494 } {} |
| 495 | 495 |
| 496 db close | 496 db close |
| 497 db2 close | 497 db2 close |
| 498 db3 close | 498 db3 close |
| 499 sqlite3_enable_shared_cache $::enable_shared_cache | 499 sqlite3_enable_shared_cache $::enable_shared_cache |
| 500 finish_test | 500 finish_test |
| OLD | NEW |