Index: test/exclusive2.test ================================================================== --- test/exclusive2.test +++ test/exclusive2.test @@ -81,11 +81,11 @@ #----------------------------------------------------------------------- # The following tests - exclusive2-1.X - check that: # # 1-3: Build a database with connection 1, calculate a signature. -# 4-9: Modify the database using a second connection in a way that +# 4-7: Modify the database using a second connection in a way that # does not modify the freelist, then reset the pager change-counter # to the value it had before the modifications. # 8: Check that using the first connection, the database signature # is still the same. This is because it uses the in-memory cache. # It can't tell the db has changed because we reset the change-counter. @@ -96,10 +96,15 @@ # # This will only work if the database cache is large enough to hold # the entire database. In the case of 1024 byte pages, this means # the cache size must be at least 17. Otherwise, some pages will be # loaded from the database file in step 8. +# +# For similar reasons, this test does not work with the memsubsys1 permutation. +# Permutation memsubsys1 configures the pcache subsystem to use a static +# allocation of 24 pages (shared between all pagers). This is not enough for +# this test. # do_test exclusive2-1.1 { execsql { BEGIN; CREATE TABLE t1(a, b); @@ -144,14 +149,16 @@ readPagerChangeCounter test.db } {2} do_test exclusive2-1.7 { pagerChangeCounter test.db 1 } {1} -do_test exclusive2-1.9 { - t1sig - expr {[t1sig] eq $::sig} -} {1} +if {[permutation] != "memsubsys1"} { + do_test exclusive2-1.9 { + t1sig + expr {[t1sig] eq $::sig} + } {1} +} do_test exclusive2-1.10 { pagerChangeCounter test.db 2 } {2} do_test exclusive2-1.11 { expr {[t1sig] eq $::sig} Index: test/incrblob.test ================================================================== --- test/incrblob.test +++ test/incrblob.test @@ -418,90 +418,98 @@ # Then test that blob writes that take place inside of a # transaction are not visible to external connections until # after the transaction is commited and the blob channel # closed. # +# This test does not work with the "memsubsys1" configuration. +# Permutation memsubsys1 configures a very small static allocation +# for use as page-cache memory. This causes SQLite to upgrade +# to an exclusive lock when writing earlier than usual, which +# makes some of these tests fail. +# sqlite3_soft_heap_limit 0 -do_test incrblob-6.1 { - sqlite3 db2 test.db - execsql { - BEGIN; - INSERT INTO blobs(k, v, i) VALUES('a', 'different', 'connection'); - } db2 -} {} -do_test incrblob-6.2 { - execsql { - SELECT rowid FROM blobs - } -} {1 2 3} -do_test incrblob-6.3 { - set rc [catch { - db incrblob blobs v 1 - } msg] - list $rc $msg -} {1 {database is locked}} -do_test incrblob-6.4 { - set rc [catch { - db incrblob blobs v 3 - } msg] - list $rc $msg -} {1 {database is locked}} -do_test incrblob-6.5 { - set ::blob [db incrblob -readonly blobs v 3] - read $::blob -} {hello} -do_test incrblob-6.6 { - close $::blob -} {} - -do_test incrblob-6.7 { - set ::blob [db2 incrblob blobs i 4] - gets $::blob -} {connection} -do_test incrblob-6.8 { - tell $::blob -} {10} -do_test incrblob-6.9 { - seek $::blob 0 - puts -nonewline $::blob "invocation" - flush $::blob -} {} - -# At this point rollback should be illegal (because -# there is an open blob channel). But commit is also illegal because -# the open blob is read-write. -# -do_test incrblob-6.10 { - catchsql { - ROLLBACK; - } db2 -} {1 {cannot rollback transaction - SQL statements in progress}} -do_test incrblob-6.11 { - catchsql { - COMMIT; - } db2 -} {1 {cannot commit transaction - SQL statements in progress}} - -do_test incrblob-6.12 { - execsql { - SELECT * FROM blobs WHERE rowid = 4; - } -} {} -do_test incrblob-6.13 { - close $::blob -} {} -do_test incrblob-6.14 { - catchsql { - COMMIT; - } db2 -} {0 {}} -do_test incrblob-6.15 { - execsql { - SELECT * FROM blobs WHERE rowid = 4; - } -} {a different invocation} -db2 close +if {[permutation] != "memsubsys1"} { + do_test incrblob-6.1 { + sqlite3 db2 test.db + execsql { + BEGIN; + INSERT INTO blobs(k, v, i) VALUES('a', 'different', 'connection'); + } db2 + } {} + do_test incrblob-6.2 { + execsql { + SELECT rowid FROM blobs + } + } {1 2 3} + do_test incrblob-6.3 { + set rc [catch { + db incrblob blobs v 1 + } msg] + list $rc $msg + } {1 {database is locked}} + do_test incrblob-6.4 { + set rc [catch { + db incrblob blobs v 3 + } msg] + list $rc $msg + } {1 {database is locked}} + do_test incrblob-6.5 { + set ::blob [db incrblob -readonly blobs v 3] + read $::blob + } {hello} + do_test incrblob-6.6 { + close $::blob + } {} + + do_test incrblob-6.7 { + set ::blob [db2 incrblob blobs i 4] + gets $::blob + } {connection} + do_test incrblob-6.8 { + tell $::blob + } {10} + do_test incrblob-6.9 { + seek $::blob 0 + puts -nonewline $::blob "invocation" + flush $::blob + } {} + + # At this point rollback should be illegal (because + # there is an open blob channel). But commit is also illegal because + # the open blob is read-write. + # + do_test incrblob-6.10 { + catchsql { + ROLLBACK; + } db2 + } {1 {cannot rollback transaction - SQL statements in progress}} + do_test incrblob-6.11 { + catchsql { + COMMIT; + } db2 + } {1 {cannot commit transaction - SQL statements in progress}} + + do_test incrblob-6.12 { + execsql { + SELECT * FROM blobs WHERE rowid = 4; + } + } {} + do_test incrblob-6.13 { + close $::blob + } {} + do_test incrblob-6.14 { + catchsql { + COMMIT; + } db2 + } {0 {}} + do_test incrblob-6.15 { + execsql { + SELECT * FROM blobs WHERE rowid = 4; + } + } {a different invocation} + db2 close +} sqlite3_soft_heap_limit $cmdlinearg(soft-heap-limit) #----------------------------------------------------------------------- # The following tests verify the behaviour of the incremental IO # APIs in the following cases: Index: test/pagerfault.test ================================================================== --- test/pagerfault.test +++ test/pagerfault.test @@ -672,25 +672,33 @@ if {[catch {db backup test.db2} msg]} { error [regsub {.*: } $msg {}] } } -test { faultsim_test_result {0 {}} {1 {}} {1 {SQL logic error or missing database}} } -do_faultsim_test pagerfault-14b -prep { - catch { db2 close } - faultsim_restore_and_reopen - sqlite3 db2 "" - db2 eval { PRAGMA page_size = 4096; CREATE TABLE xx(a) } -} -body { - sqlite3_backup B db2 main db main - B step 200 - set rc [B finish] - if {[string match SQLITE_IOERR_* $rc]} {set rc SQLITE_IOERR} - if {$rc != "SQLITE_OK"} { error [sqlite3_test_errstr $rc] } - set {} {} -} -test { - faultsim_test_result {0 {}} {1 {sqlite3_backup_init() failed}} -} +# If TEMP_STORE is 2 or greater, then the database [db2] will be created +# as an in-memory database. This test will not work in that case, as it +# is not possible to change the page-size of an in-memory database. Even +# using the backup API. +# +if {$TEMP_STORE<2} { + do_faultsim_test pagerfault-14b -prep { + catch { db2 close } + faultsim_restore_and_reopen + sqlite3 db2 "" + db2 eval { PRAGMA page_size = 4096; CREATE TABLE xx(a) } + } -body { + sqlite3_backup B db2 main db main + B step 200 + set rc [B finish] + if {[string match SQLITE_IOERR_* $rc]} {set rc SQLITE_IOERR} + if {$rc != "SQLITE_OK"} { error [sqlite3_test_errstr $rc] } + set {} {} + } -test { + faultsim_test_result {0 {}} {1 {sqlite3_backup_init() failed}} + } +} + do_faultsim_test pagerfault-14c -prep { catch { db2 close } faultsim_restore_and_reopen sqlite3 db2 test.db2 db2 eval { Index: test/permutations.test ================================================================== --- test/permutations.test +++ test/permutations.test @@ -93,11 +93,11 @@ set alltests [test_set $alltests -exclude crash.test crash2.test] } set alltests [test_set $alltests -exclude { all.test async.test quick.test veryquick.test memleak.test permutations.test soak.test fts3.test - mallocAll.tes rtree.test + mallocAll.test rtree.test }] set allquicktests [test_set $alltests -exclude { async2.test async3.test backup_ioerr.test corrupt.test corruptC.test crash.test crash2.test crash3.test crash4.test crash5.test