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

Handle some of the IO error conditions that may occur in a shared-cache context. (CVS 2980)

FossilOrigin-Name: 97491d4eb5fc24d8f5cc7605db844359ecc6a818
This commit is contained in:
danielk1977
2006-01-20 10:55:05 +00:00
parent f98477b846
commit 07cb560b23
10 changed files with 337 additions and 107 deletions

View File

@ -13,7 +13,7 @@
# correctly. The emphasis of these tests are the _prepare(), _step() and
# _finalize() calls.
#
# $Id: malloc3.test,v 1.6 2006/01/10 18:27:42 danielk1977 Exp $
# $Id: malloc3.test,v 1.7 2006/01/20 10:55:05 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -482,6 +482,24 @@ TEST 31 {
} {1 2 3 1 2 3}
}
# Test what happens when a malloc() fails while there are other active
# statements. This changes the way sqlite3VdbeHalt() works.
TEST 32 {
if {![info exists ::STMT32]} {
set sql "SELECT name FROM sqlite_master"
set ::STMT32 [sqlite3_prepare $::DB $sql -1 DUMMY]
do_test $testid {
sqlite3_step $::STMT32
} {SQLITE_ROW}
}
puts [execsql {SELECT * FROM ghi}]
}
SQL {
BEGIN;
INSERT INTO ghi SELECT * FROM ghi;
COMMIT;
}
#
# End of test program declaration
#--------------------------------------------------------------------------
@ -612,7 +630,7 @@ proc run_test {arglist {pcstart 0} {iFailStart 1}} {
# Turn of the Tcl interface's prepared statement caching facility.
db cache size 0
run_test $::run_test_script
run_test $::run_test_script 76 6
# run_test [lrange $::run_test_script 0 3] 0 63
sqlite_malloc_fail 0
db close