------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
-C Make\ssure\sthe\swal-index\sreader\sdetects\san\sincorrect\sversion\snumber\seven\sif\nit\shad\sto\shold\sa\slock\sin\sorder\sto\sread\sthe\swal-index.\s\sAlso,\sexpand\sand\senhance\nvarious\scomments\sin\swal.c.
-D 2010-06-24T02:46:49
+C Add\scoverage\stests.\sRemove\sa\sNEVER\smacro\sfrom\spager.c,\sas\sthe\scondition\scan\snow\sbe\strue\sin\swal\smode.
+D 2010-06-24T10:50:18
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in a5cad1f8f3e021356bfcc6c77dc16f6f1952bbc3
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F src/os_os2.c 665876d5eec7585226b0a1cf5e18098de2b2da19
F src/os_unix.c 4b03e5a8a353b51af64ba11ffec85160818b4d89
F src/os_win.c 00385a839d54f951a73ceb98ddea29112adea05c
-F src/pager.c e42b2e21c825c4110206bec357b53a35dda27416
+F src/pager.c c1c7f498795240b81a3d3d91460d5aa5ea023c65
F src/pager.h 879fdde5a102d2f21a3135d6f647530b21c2796c
F src/parse.y ace5c7a125d9f2a410e431ee3209034105045f7e
F src/pcache.c 1e9aa2dbc0845b52e1b51cc39753b6d1e041cb07
F test/mallocI.test e3ea401904d010cb7c1e4b2ee8803f4a9f5b999d
F test/mallocJ.test b5d1839da331d96223e5f458856f8ffe1366f62e
F test/mallocK.test d79968641d1b70d88f6c01bdb9a7eb4a55582cc9
-F test/malloc_common.tcl 0bb7fd59dfc7220de4dac37582fdb8acf7092c7b
+F test/malloc_common.tcl c5a4688c3744f69450d88909d2a6cd2644f76803
F test/manydb.test b3d3bc4c25657e7f68d157f031eb4db7b3df0d3c
F test/memdb.test 0825155b2290e900264daaaf0334b6dfe69ea498
F test/memleak.test 10b9c6c57e19fc68c32941495e9ba1c50123f6e2
F test/notnull.test cc7c78340328e6112a13c3e311a9ab3127114347
F test/null.test a8b09b8ed87852742343b33441a9240022108993
F test/openv2.test af02ed0a9cbc0d2a61b8f35171d4d117e588e4ec
-F test/pager1.test 31478e94375cb3725a2ffe8b84196520a8248c36
+F test/pager1.test 2fb769a4f121b4e27525ea7e38d6d0176a0c2a9f
F test/pager2.test f5c757c271ce642d36a393ecbfb3aef1c240dcef
-F test/pagerfault.test 4e85adb13fde0c41a3c56b5bdbab6ee8a7fd8571
+F test/pagerfault.test d0112f04b2759d74dda4c2ff1352e344a6d162f9
F test/pageropt.test 8146bf448cf09e87bb1867c2217b921fb5857806
F test/pagesize.test 76aa9f23ecb0741a4ed9d2e16c5fa82671f28efb
F test/pcache.test 4118a183908ecaed343a06fcef3ba82e87e0129d
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P ee9991be082202c6637adb47affc777e7917be04
-R df56ab9f7222776abd3e8b42ef209701
-U drh
-Z 85f62e57e9c5554f99cfd3649411a9ff
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.6 (GNU/Linux)
-
-iD8DBQFMIscdoxKgR168RlERAh1nAJ47gefagsKL4XohGBiiEgmsbUY6vgCfcfRz
-mTG8eTaypLtEv2BjR4hvPQw=
-=bshK
------END PGP SIGNATURE-----
+P 2e6a462cebc05bfd4648d26dd5ae70b68844aa5f
+R 6f0d6e2596113b96c1a8578d8b29dee5
+U dan
+Z e559ebbb3187a59709a564e36f19cc0a
-2e6a462cebc05bfd4648d26dd5ae70b68844aa5f
\ No newline at end of file
+7aac9ad6dd14b1c56eb8e4750ac769c6197c30bd
\ No newline at end of file
assert( pPager->journalMode!=PAGER_JOURNALMODE_OFF || pPager->dbOrigSize==0 );
/* If a prior error occurred, report that error again. */
- if( NEVER(pPager->errCode) ) return pPager->errCode;
+ if( pPager->errCode ) return pPager->errCode;
PAGERTRACE(("DATABASE SYNC: File=%s zMaster=%s nSize=%d\n",
pPager->zFilename, zMaster, pPager->dbSize));
return $sv
}
-
# The following procs are used as [do_one_faultsim_test] callbacks when
# injecting shared-memory related error faults into test cases.
#
shmfault ioerr 0 0
}
+# The following procs are used as [do_one_faultsim_test] callbacks when
+# injecting SQLITE_FULL error faults into test cases.
+#
proc fullerr_injectinstall {} {
testvfs shmfault -default true
}
#
# pager1-8.*: Cases using temporary and in-memory databases.
#
+# pager1-9.*: Tests related to the backup API.
+#
set a_string_counter 1
proc a_string {n} {
#-------------------------------------------------------------------------
# Savepoint related test cases.
+#
+# pager1-3.1.2.*: Force a savepoint rollback to cause the database file
+# to grow.
#
do_test pager1-3.1.1 {
faultsim_delete_and_reopen
do_execsql_test pager1-3.5 { SELECT a FROM t1 } {1 2 3}
do_execsql_test pager1-3.6 { COMMIT } {}
+do_test pager1-3.2.1 {
+ faultsim_delete_and_reopen
+ db func a_string a_string
+ execsql {
+ PRAGMA auto_vacuum = 2;
+ PRAGMA cache_size = 10;
+ CREATE TABLE z(x INTEGER PRIMARY KEY, y);
+ BEGIN;
+ INSERT INTO z VALUES(NULL, a_string(800));
+ INSERT INTO z SELECT NULL, a_string(800) FROM z; -- 2
+ INSERT INTO z SELECT NULL, a_string(800) FROM z; -- 4
+ INSERT INTO z SELECT NULL, a_string(800) FROM z; -- 8
+ INSERT INTO z SELECT NULL, a_string(800) FROM z; -- 16
+ INSERT INTO z SELECT NULL, a_string(800) FROM z; -- 32
+ INSERT INTO z SELECT NULL, a_string(800) FROM z; -- 64
+ INSERT INTO z SELECT NULL, a_string(800) FROM z; -- 128
+ INSERT INTO z SELECT NULL, a_string(800) FROM z; -- 256
+ COMMIT;
+ }
+ execsql { PRAGMA auto_vacuum }
+} {2}
+do_execsql_test pager1-3.2.2 {
+ BEGIN;
+ INSERT INTO z VALUES(NULL, a_string(800));
+ INSERT INTO z VALUES(NULL, a_string(800));
+ SAVEPOINT one;
+ DELETE FROM z WHERE x>256;
+ PRAGMA incremental_vacuum;
+ SELECT count(*) FROM z WHERE x < 100;
+ ROLLBACK TO one;
+ COMMIT;
+} {99}
+
#-------------------------------------------------------------------------
# Hot journal rollback related test cases.
#
} {}
}
+#-------------------------------------------------------------------------
+# The next block of tests - pager1-9.* - deal with interactions between
+# the pager and the backup API. Test cases:
+#
+# pager1-9.1.*: Test that a backup completes successfully even if the
+# source db is written to during the backup op.
+#
+# pager1-9.2.*: Test that a backup completes successfully even if the
+# source db is written to and then rolled back during a
+# backup operation.
+#
+do_test pager1-9.0.1 {
+ faultsim_delete_and_reopen
+ db func a_string a_string
+ execsql {
+ PRAGMA cache_size = 10;
+ BEGIN;
+ CREATE TABLE ab(a, b, UNIQUE(a, b));
+ INSERT INTO ab VALUES( a_string(200), a_string(300) );
+ INSERT INTO ab SELECT a_string(200), a_string(300) FROM ab;
+ INSERT INTO ab SELECT a_string(200), a_string(300) FROM ab;
+ INSERT INTO ab SELECT a_string(200), a_string(300) FROM ab;
+ INSERT INTO ab SELECT a_string(200), a_string(300) FROM ab;
+ INSERT INTO ab SELECT a_string(200), a_string(300) FROM ab;
+ INSERT INTO ab SELECT a_string(200), a_string(300) FROM ab;
+ INSERT INTO ab SELECT a_string(200), a_string(300) FROM ab;
+ COMMIT;
+ }
+} {}
+do_test pager1-9.0.2 {
+ sqlite3 db2 test.db2
+ db2 eval { PRAGMA cache_size = 10 }
+ sqlite3_backup B db2 main db main
+ list [B step 10000] [B finish]
+} {SQLITE_DONE SQLITE_OK}
+do_test pager1-9.0.3 {
+ db one {SELECT md5sum(a, b) FROM ab}
+} [db2 one {SELECT md5sum(a, b) FROM ab}]
+
+do_test pager1-9.1.1 {
+ execsql { UPDATE ab SET a = a_string(201) }
+ sqlite3_backup B db2 main db main
+ B step 30
+} {SQLITE_OK}
+do_test pager1-9.1.2 {
+ execsql { UPDATE ab SET b = a_string(301) }
+ list [B step 10000] [B finish]
+} {SQLITE_DONE SQLITE_OK}
+do_test pager1-9.1.3 {
+ db one {SELECT md5sum(a, b) FROM ab}
+} [db2 one {SELECT md5sum(a, b) FROM ab}]
+do_test pager1-9.1.4 { execsql { SELECT count(*) FROM ab } } {128}
+
+do_test pager1-9.2.1 {
+ execsql { UPDATE ab SET a = a_string(202) }
+ sqlite3_backup B db2 main db main
+ B step 30
+} {SQLITE_OK}
+do_test pager1-9.2.2 {
+ execsql {
+ BEGIN;
+ UPDATE ab SET b = a_string(301);
+ ROLLBACK;
+ }
+ list [B step 10000] [B finish]
+} {SQLITE_DONE SQLITE_OK}
+do_test pager1-9.2.3 {
+ db one {SELECT md5sum(a, b) FROM ab}
+} [db2 one {SELECT md5sum(a, b) FROM ab}]
+do_test pager1-9.2.4 { execsql { SELECT count(*) FROM ab } } {128}
+
finish_test
# faultsim_integrity_check
# }
#
+
+# This is designed to provoke a special case in the pager code:
+#
+# If an error (specifically, a FULL or IOERR error) occurs while writing a
+# dirty page to the file-system in order to free up memory, the pager enters
+# the "error state". An IO error causes SQLite to roll back the current
+# transaction (exiting the error state). A FULL error, however, may only
+# rollback the current statement.
+#
+# This block tests that nothing goes wrong if a FULL error occurs while
+# writing a dirty page out to free memory from within a statement that has
+# opened a statement transaction.
+#
do_test pagerfault-7-pre1 {
faultsim_delete_and_reopen
execsql {
faultsim_integrity_check
}
+do_test pagerfault-8-pre1 {
+ faultsim_delete_and_reopen
+ execsql {
+ PRAGMA auto_vacuum = 1;
+ CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
+ BEGIN;
+ INSERT INTO t1 VALUES(NULL, randomblob(1500));
+ INSERT INTO t1 VALUES(NULL, randomblob(1500));
+ INSERT INTO t1 SELECT NULL, randomblob(1500) FROM t1; -- 4
+ INSERT INTO t1 SELECT NULL, randomblob(1500) FROM t1; -- 8
+ INSERT INTO t1 SELECT NULL, randomblob(1500) FROM t1; -- 16
+ INSERT INTO t1 SELECT NULL, randomblob(1500) FROM t1; -- 32
+ INSERT INTO t1 SELECT NULL, randomblob(1500) FROM t1; -- 64
+ COMMIT;
+ }
+ faultsim_save_and_close
+ set filesize [file size test.db]
+ set {} {}
+} {}
+do_test pagerfault-8-pre2 {
+ faultsim_restore_and_reopen
+ execsql { DELETE FROM t1 WHERE a>32 }
+ expr {[file size test.db] < $filesize}
+} {1}
+breakpoint
+do_faultsim_test pagerfault-8 -prep {
+ faultsim_restore_and_reopen
+ execsql {
+ BEGIN;
+ DELETE FROM t1 WHERE a>32;
+ }
+} -body {
+ execsql COMMIT
+} -test {
+ faultsim_test_result {0 {}}
+ faultsim_integrity_check
+}
+
finish_test