1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Fix the shared_err.test script so that it works if the device supports SQLITE_IOCAP_SAFEAPPEND. (CVS 5699)

FossilOrigin-Name: 38e5ea070a38fe1656e0f5c3024f28ce67eae725
This commit is contained in:
danielk1977
2008-09-15 14:42:38 +00:00
parent 92c4b8a2ca
commit 78a906552d
3 changed files with 23 additions and 14 deletions

View File

@ -13,7 +13,7 @@
# cache context. What happens to connection B if one connection A encounters
# an IO-error whilst reading or writing the file-system?
#
# $Id: shared_err.test,v 1.21 2008/07/07 17:55:29 danielk1977 Exp $
# $Id: shared_err.test,v 1.22 2008/09/15 14:42:38 danielk1977 Exp $
proc skip {args} {}
@ -57,12 +57,13 @@ do_ioerr_test shared_ioerr-1 -tclprep {
set res [catchsql {
SELECT * FROM t1;
} db2]
set possible_results [list \
"1 {disk I/O error}" \
"0 {1 2 3}" \
"0 {1 2 3 1 2 3 4 5 6}" \
"0 {1 2 3 1 2 3 4 5 6 1 2 3 4 5 6}" \
"0 {}" \
set possible_results [list \
"1 {disk I/O error}" \
"0 {1 2 3}" \
"0 {1 2 3 1 2 3 4 5 6}" \
"0 {1 2 3 1 2 3 4 5 6 1 2 3 4 5 6}" \
"0 {}" \
"1 {database disk image is malformed}" \
]
set rc [expr [lsearch -exact $possible_results $res] >= 0]
if {$rc != 1} {
@ -71,7 +72,15 @@ do_ioerr_test shared_ioerr-1 -tclprep {
}
set rc
} {1}
# The "database disk image is malformed" is a special case that can
# occur if an IO error occurs during a rollback in the {SELECT * FROM t1}
# statement above. This test is to make sure there is no real database
# corruption.
db2 close
do_test shared_ioerr-1.$n.cleanup.2 {
execsql {pragma integrity_check} db
} {ok}
}
do_ioerr_test shared_ioerr-2 -tclprep {