mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-27 20:41:58 +03:00
Misc fixes for test cases failing due to the new locking model. (CVS 1561)
FossilOrigin-Name: 71e98d0d089576433c4b06dcba1c57063bd366f5
This commit is contained in:
@ -11,7 +11,7 @@
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this file is testing the DELETE FROM statement.
|
||||
#
|
||||
# $Id: delete.test,v 1.14 2004/05/27 17:22:56 drh Exp $
|
||||
# $Id: delete.test,v 1.15 2004/06/10 05:59:25 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -277,11 +277,16 @@ do_test delete-8.3 {
|
||||
do_test delete-8.4 {
|
||||
execsql {SELECT * FROM t3}
|
||||
} {123}
|
||||
|
||||
# Update for v3: In v2 the DELETE statement would succeed because no
|
||||
# database writes actually occur. Version 3 refuses to open a transaction
|
||||
# on a read-only file, so the statement fails.
|
||||
do_test delete-8.5 {
|
||||
catchsql {
|
||||
DELETE FROM t3 WHERE a<100;
|
||||
}
|
||||
} {0 {}}
|
||||
# v2 result: {0 {}}
|
||||
} {1 {attempt to write a readonly database}}
|
||||
do_test delete-8.6 {
|
||||
execsql {SELECT * FROM t3}
|
||||
} {123}
|
||||
|
@ -13,7 +13,7 @@
|
||||
# various suported unicode encodings (UTF-8, UTF-16, UTF-16le and
|
||||
# UTF-16be).
|
||||
#
|
||||
# $Id: enc2.test,v 1.6 2004/06/09 12:30:06 danielk1977 Exp $
|
||||
# $Id: enc2.test,v 1.7 2004/06/10 05:59:25 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -142,4 +142,6 @@ do_test enc2-4.3 {
|
||||
}
|
||||
} {1 {attached databases must use the same text encoding as main database}}
|
||||
|
||||
db2 close
|
||||
|
||||
finish_test
|
||||
|
@ -13,7 +13,7 @@
|
||||
# This file implements tests for miscellanous features that were
|
||||
# left out of other test files.
|
||||
#
|
||||
# $Id: misc1.test,v 1.26 2004/06/09 09:55:20 danielk1977 Exp $
|
||||
# $Id: misc1.test,v 1.27 2004/06/10 05:59:25 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -323,13 +323,16 @@ do_test misc1-10.10 {
|
||||
# Make sure the initialization works even if a database is opened while
|
||||
# another process has the database locked.
|
||||
#
|
||||
# Update for v3: The BEGIN doesn't lock the database so the schema is read
|
||||
# and the SELECT returns successfully.
|
||||
do_test misc1-11.1 {
|
||||
execsql {BEGIN}
|
||||
execsql {UPDATE t1 SET a=0 WHERE 0}
|
||||
sqlite db2 test.db
|
||||
set rc [catch {db2 eval {SELECT count(*) FROM t1}} msg]
|
||||
lappend rc $msg
|
||||
} {1 {database is locked}}
|
||||
# v2 result: {1 {database is locked}}
|
||||
} {0 3}
|
||||
do_test misc1-11.2 {
|
||||
execsql {COMMIT}
|
||||
set rc [catch {db2 eval {SELECT count(*) FROM t1}} msg]
|
||||
|
@ -11,7 +11,7 @@
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this script is multithreading behavior
|
||||
#
|
||||
# $Id: thread1.test,v 1.4 2004/06/02 06:30:18 danielk1977 Exp $
|
||||
# $Id: thread1.test,v 1.5 2004/06/10 05:59:25 danielk1977 Exp $
|
||||
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
@ -123,17 +123,24 @@ do_test thread1-2.3 {
|
||||
thread_compile C {INSERT INTO t2 VALUES(98,99)}
|
||||
thread_step C
|
||||
thread_result C
|
||||
thread_finalize C
|
||||
thread_result C
|
||||
} SQLITE_BUSY
|
||||
|
||||
do_test thread1-2.4 {
|
||||
execsql {SELECT * FROM t2}
|
||||
} {}
|
||||
|
||||
do_test thread1-2.5 {
|
||||
thread_finalize A
|
||||
thread_result A
|
||||
} SQLITE_OK
|
||||
do_test thread1-2.6 {
|
||||
thread_compile C {INSERT INTO t2 VALUES(98,99)}
|
||||
thread_step C
|
||||
thread_result C
|
||||
thread_finalize C
|
||||
thread_result C
|
||||
} SQLITE_BUSY
|
||||
do_test thread1-2.7 {
|
||||
execsql {SELECT * FROM t2}
|
||||
@ -143,6 +150,7 @@ do_test thread1-2.8 {
|
||||
thread_result B
|
||||
} SQLITE_OK
|
||||
do_test thread1-2.9 {
|
||||
thread_compile C {INSERT INTO t2 VALUES(98,99)}
|
||||
thread_step C
|
||||
thread_result C
|
||||
} SQLITE_DONE
|
||||
|
Reference in New Issue
Block a user