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

Update shared_err.test to work with (5668) (return SQLITE_CORRUPT if rollback fails). (CVS 5748)

FossilOrigin-Name: 292acaf7c4e68b532cc8d1763e02aa79d90ea20c
This commit is contained in:
danielk1977
2008-09-29 14:12:56 +00:00
parent 71d5d2cd49
commit 7aad2983c9
3 changed files with 19 additions and 10 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.22 2008/09/15 14:42:38 danielk1977 Exp $
# $Id: shared_err.test,v 1.23 2008/09/29 14:12:57 danielk1977 Exp $
proc skip {args} {}
@ -410,11 +410,19 @@ do_malloc_test shared_err-8 -tclprep {
ROLLBACK;
}
} -cleanup {
# UPDATE: As of [5668], if the rollback fails SQLITE_CORRUPT is returned.
# So these tests have been updated to expect SQLITE_CORRUPT and its
# associated English language error message.
#
do_test shared_malloc-8.$::n.cleanup.1 {
set res [catchsql {SELECT a FROM t1} db2]
set ans [lindex $res 1]
if {[lindex $res 0]} {
set r [expr {$ans=="disk I/O error" || $ans=="out of memory"}]
set r [expr {
$ans=="disk I/O error" ||
$ans=="out of memory" ||
$ans=="database disk image is malformed"
}]
} else {
set r [expr {[lrange $ans 0 1]=="0000000000 1111111111"}]
}
@ -429,7 +437,8 @@ do_malloc_test shared_err-8 -tclprep {
($rc1=="SQLITE_DONE" && $rc2=="SQLITE_OK") ||
($rc1=="SQLITE_ERROR" && $rc2=="SQLITE_ABORT") ||
($rc1=="SQLITE_ERROR" && $rc2=="SQLITE_NOMEM") ||
($rc1=="SQLITE_ERROR" && $rc2=="SQLITE_IOERR")
($rc1=="SQLITE_ERROR" && $rc2=="SQLITE_IOERR") ||
($rc1=="SQLITE_ERROR" && $rc2=="SQLITE_CORRUPT")
}
} {1}
db2 close