1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Add tests to make sure the busy handler resets. (CVS 4865)

FossilOrigin-Name: 5e4df441815ed7d02e9ad8ee2e1c2f937ee675d7
This commit is contained in:
drh
2008-03-15 02:09:21 +00:00
parent befdf83f58
commit 175cd71bab
3 changed files with 27 additions and 10 deletions

View File

@ -10,7 +10,7 @@
#***********************************************************************
# This file test the busy handler
#
# $Id: busy.test,v 1.2 2005/09/17 18:02:37 drh Exp $
# $Id: busy.test,v 1.3 2008/03/15 02:09:22 drh Exp $
set testdir [file dirname $argv0]
@ -32,12 +32,29 @@ proc busy x {
set busyargs {}
do_test busy-1.2 {
db busy busy
db2 eval {begin exclusive}
catchsql {begin immediate}
db2 eval {BEGIN EXCLUSIVE}
catchsql {BEGIN IMMEDIATE}
} {1 {database is locked}}
do_test busy-1.3 {
set busyargs
} {0 1 2 3}
do_test busy-1.4 {
set busyargs {}
catchsql {BEGIN IMMEDIATE}
set busyargs
} {0 1 2 3}
do_test busy-2.1 {
db2 eval {COMMIT}
db eval {BEGIN; INSERT INTO t1 VALUES(5)}
db2 eval {BEGIN; SELECT * FROM t1}
set busyargs {}
catchsql COMMIT
} {1 {database is locked}}
do_test busy-2.2 {
set busyargs
} {0 1 2 3}
db2 close