Change os_unix.c to propagate ENOENT errors back to sqlite as SQLITE_IOERR_DELETE_NOENT. Have SQLite ignore these where they are benign and propagate them back to the caller where they may indicate a file-system malfunction of some description.

FossilOrigin-Name: bed9c172ce624ab7b5b9de9ad42444891717ad9a
This commit is contained in:
dan
2012-11-09 20:17:26 +00:00
parent 9c0a8ee57c
commit 9fc5b4a539
6 changed files with 48 additions and 13 deletions
+28
View File
@@ -2487,4 +2487,32 @@ do_test pager1-32.1 {
# Cleanup 20MB file left by the previous test.
forcedelete test.db
#-------------------------------------------------------------------------
# Test that if a transaction is committed in journal_mode=DELETE mode,
# and the call to unlink() returns an ENOENT error, the COMMIT does not
# succeed.
#
if {$::tcl_platform(platform)=="unix"} {
do_test pager1-33.1 {
sqlite3 db test.db
execsql {
CREATE TABLE t1(x);
INSERT INTO t1 VALUES('one');
INSERT INTO t1 VALUES('two');
BEGIN;
INSERT INTO t1 VALUES('three');
INSERT INTO t1 VALUES('four');
}
forcedelete bak-journal
file rename test.db-journal bak-journal
catchsql COMMIT
} {1 {disk I/O error}}
do_test pager1-33.2 {
file rename bak-journal test.db-journal
execsql { SELECT * FROM t1 }
} {one two}
}
finish_test