Always transform error code SQLITE_IOERR_NOMEM to SQLITE_NOMEM before returning. This was already happening in most places. (CVS 5738)

FossilOrigin-Name: 046ef07261d520c9399bd8cdfdfd5281956b7a27
This commit is contained in:
danielk1977
2008-09-23 16:41:29 +00:00
parent 40bbb0a3e8
commit 98c21903bd
7 changed files with 36 additions and 27 deletions
+17 -7
View File
@@ -16,7 +16,7 @@
# to see what happens in the library if a malloc were to really fail
# due to an out-of-memory situation.
#
# $Id: malloc.test,v 1.66 2008/09/22 17:22:20 danielk1977 Exp $
# $Id: malloc.test,v 1.67 2008/09/23 16:41:30 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -39,7 +39,6 @@ sqlite3_memdebug_dump $testdir
puts "Memory dump to file memdump.txt..."
sqlite3_memdebug_dump memdump.txt
ifcapable bloblit&&subquery {
do_malloc_test 1 -tclprep {
db close
@@ -346,9 +345,14 @@ if {$tcl_platform(platform)!="windows"} {
} -tclbody {
sqlite3 db test.db
sqlite3_extended_result_codes db 1
db eval {
SELECT * FROM t1;
}
# If an out-of-memory occurs within a call to a VFS layer function during
# hot-journal rollback, sqlite will report SQLITE_CORRUPT. See commit
# [5668] for details.
set rc [catch {db eval { SELECT * FROM t1 }} msg]
if {$msg eq "database disk image is malformed"} { set msg "out of memory" }
if {$rc} { error $msg }
set msg
}
}
@@ -568,8 +572,14 @@ ifcapable {pager_pragmas} {
set ::sqlite_io_error_pending 10
catch {db eval {ROLLBACK}} msg
} -sqlbody {
SELECT * FROM abc LIMIT 10;
} -tclbody {
# If an out-of-memory occurs within a call to a VFS layer function during
# hot-journal rollback, sqlite will report SQLITE_CORRUPT. See commit
# [5668] for details.
set rc [catch {db eval { SELECT * FROM abc LIMIT 10 }} msg]
if {$msg eq "database disk image is malformed"} { set msg "out of memory" }
if {$rc} { error $msg }
set msg
} -cleanup {
set e [db eval {PRAGMA integrity_check}]
if {$e ne "ok"} {error $e}
+1 -2
View File
@@ -12,7 +12,7 @@
# This file contains common code used by many different malloc tests
# within the test suite.
#
# $Id: malloc_common.tcl,v 1.21 2008/08/04 20:13:27 drh Exp $
# $Id: malloc_common.tcl,v 1.22 2008/09/23 16:41:30 danielk1977 Exp $
# If we did not compile with malloc testing enabled, then do nothing.
#
@@ -147,7 +147,6 @@ proc do_malloc_test {tn args} {
} elseif {
[info command db]=="" ||
[db errorcode]==7 ||
[db errorcode]==[expr 10+(12<<8)] ||
$msg=="out of memory"
} {
set v2 1