OLD | NEW |
1 # 2001 September 15 | 1 # 2001 September 15 |
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 229 matching lines...) Loading... |
240 execsql {ROLLBACK} | 240 execsql {ROLLBACK} |
241 | 241 |
242 # Test the built-in busy timeout handler | 242 # Test the built-in busy timeout handler |
243 # | 243 # |
244 do_test lock-2.8 { | 244 do_test lock-2.8 { |
245 db2 timeout 400 | 245 db2 timeout 400 |
246 execsql BEGIN | 246 execsql BEGIN |
247 execsql {UPDATE t1 SET a = 0 WHERE 0} | 247 execsql {UPDATE t1 SET a = 0 WHERE 0} |
248 catchsql {BEGIN EXCLUSIVE;} db2 | 248 catchsql {BEGIN EXCLUSIVE;} db2 |
249 } {1 {database is locked}} | 249 } {1 {database is locked}} |
| 250 do_test lock-2.8b { |
| 251 db2 eval {PRAGMA busy_timeout} |
| 252 } {400} |
250 do_test lock-2.9 { | 253 do_test lock-2.9 { |
251 db2 timeout 0 | 254 db2 timeout 0 |
252 execsql COMMIT | 255 execsql COMMIT |
253 } {} | 256 } {} |
| 257 do_test lock-2.9b { |
| 258 db2 eval {PRAGMA busy_timeout} |
| 259 } {0} |
254 integrity_check lock-2.10 | 260 integrity_check lock-2.10 |
| 261 do_test lock-2.11 { |
| 262 db2 eval {PRAGMA busy_timeout(400)} |
| 263 execsql BEGIN |
| 264 execsql {UPDATE t1 SET a = 0 WHERE 0} |
| 265 catchsql {BEGIN EXCLUSIVE;} db2 |
| 266 } {1 {database is locked}} |
| 267 do_test lock-2.11b { |
| 268 db2 eval {PRAGMA busy_timeout} |
| 269 } {400} |
| 270 do_test lock-2.12 { |
| 271 db2 eval {PRAGMA busy_timeout(0)} |
| 272 execsql COMMIT |
| 273 } {} |
| 274 do_test lock-2.12b { |
| 275 db2 eval {PRAGMA busy_timeout} |
| 276 } {0} |
| 277 integrity_check lock-2.13 |
255 | 278 |
256 # Try to start two transactions in a row | 279 # Try to start two transactions in a row |
257 # | 280 # |
258 do_test lock-3.1 { | 281 do_test lock-3.1 { |
259 execsql {BEGIN TRANSACTION} | 282 execsql {BEGIN TRANSACTION} |
260 set r [catch {execsql {BEGIN TRANSACTION}} msg] | 283 set r [catch {execsql {BEGIN TRANSACTION}} msg] |
261 execsql {ROLLBACK} | 284 execsql {ROLLBACK} |
262 lappend r $msg | 285 lappend r $msg |
263 } {1 {cannot start a transaction within a transaction}} | 286 } {1 {cannot start a transaction within a transaction}} |
264 integrity_check lock-3.2 | 287 integrity_check lock-3.2 |
(...skipping 152 matching lines...) Loading... |
417 } [list main shared temp $temp_status] | 440 } [list main shared temp $temp_status] |
418 do_test lock-7.4 { | 441 do_test lock-7.4 { |
419 sqlite3_finalize $STMT | 442 sqlite3_finalize $STMT |
420 } {SQLITE_OK} | 443 } {SQLITE_OK} |
421 | 444 |
422 do_test lock-999.1 { | 445 do_test lock-999.1 { |
423 rename db2 {} | 446 rename db2 {} |
424 } {} | 447 } {} |
425 | 448 |
426 finish_test | 449 finish_test |
OLD | NEW |