mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
Add another fault-injection test for sqlite3_snapshot_recover().
FossilOrigin-Name: 7e040406138669bd67dd6ecae016b3e50dbfaaf8
This commit is contained in:
12
manifest
12
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Fix\sa\sproblem\scausing\ssqlite3_snapshot_recover()\sto\sreturn\nSQLITE_IOERR_SHORT_READ.
|
C Add\sanother\sfault-injection\stest\sfor\ssqlite3_snapshot_recover().
|
||||||
D 2016-11-19T16:35:53.322
|
D 2016-11-19T17:20:28.983
|
||||||
F Makefile.in 6b572807415d3f0a379cebc9461416d8df4a12c8
|
F Makefile.in 6b572807415d3f0a379cebc9461416d8df4a12c8
|
||||||
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
|
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
|
||||||
F Makefile.msc bb4d970894abbbe0e88d00aac29bd52af8bc95f4
|
F Makefile.msc bb4d970894abbbe0e88d00aac29bd52af8bc95f4
|
||||||
@@ -1104,7 +1104,7 @@ F test/skipscan5.test 67817a4b6857c47e0e33ba3e506da6f23ef68de2
|
|||||||
F test/skipscan6.test 5866039d03a56f5bd0b3d172a012074a1d90a15b
|
F test/skipscan6.test 5866039d03a56f5bd0b3d172a012074a1d90a15b
|
||||||
F test/snapshot.test 85735bd997a4f6d710140c28fd860519a299649f
|
F test/snapshot.test 85735bd997a4f6d710140c28fd860519a299649f
|
||||||
F test/snapshot2.test aeacd61be9ad4aafdab183e9137eeca87623edad
|
F test/snapshot2.test aeacd61be9ad4aafdab183e9137eeca87623edad
|
||||||
F test/snapshot_fault.test 566e8a45a2ba71c67bad2077072c85ac54e9dded
|
F test/snapshot_fault.test 52c5e97ebd218846a8ae2da4d147d3e77d71f963
|
||||||
F test/soak.test 0b5b6375c9f4110c828070b826b3b4b0bb65cd5f
|
F test/soak.test 0b5b6375c9f4110c828070b826b3b4b0bb65cd5f
|
||||||
F test/softheap1.test 843cd84db9891b2d01b9ab64cef3e9020f98d087
|
F test/softheap1.test 843cd84db9891b2d01b9ab64cef3e9020f98d087
|
||||||
F test/sort.test c2adc635c2564241fefec0b3a68391ef6868fd3b
|
F test/sort.test c2adc635c2564241fefec0b3a68391ef6868fd3b
|
||||||
@@ -1535,7 +1535,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
|||||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||||
P 9abeb7980a34cec11a3420e14ad98a4ec0d9c599
|
P 525f75fa9fd4a95acc3fb3b0a01dabe2be39b383
|
||||||
R 7b6eb1e1f049ba4c986979f464295360
|
R 540803770026fc0e2bba54ecd3e455de
|
||||||
U dan
|
U dan
|
||||||
Z 9f95743e0b02ecca5491496b02c4041a
|
Z a16f9ea1f945ee0adbd8c25a4885f6d9
|
||||||
|
@@ -1 +1 @@
|
|||||||
525f75fa9fd4a95acc3fb3b0a01dabe2be39b383
|
7e040406138669bd67dd6ecae016b3e50dbfaaf8
|
@@ -17,8 +17,6 @@ source $testdir/tester.tcl
|
|||||||
ifcapable !snapshot {finish_test; return}
|
ifcapable !snapshot {finish_test; return}
|
||||||
set testprefix snapshot_fault
|
set testprefix snapshot_fault
|
||||||
|
|
||||||
if 1 {
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
# Check that an sqlite3_snapshot_open() client cannot be tricked into
|
# Check that an sqlite3_snapshot_open() client cannot be tricked into
|
||||||
# reading a corrupt snapshot even if a second client fails while
|
# reading a corrupt snapshot even if a second client fails while
|
||||||
@@ -161,8 +159,6 @@ do_faultsim_test 3.0 -prep {
|
|||||||
sqlite3_snapshot_free $::snapshot
|
sqlite3_snapshot_free $::snapshot
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
# Test the handling of faults that occur within sqlite3_snapshot_recover().
|
# Test the handling of faults that occur within sqlite3_snapshot_recover().
|
||||||
#
|
#
|
||||||
@@ -175,14 +171,14 @@ do_execsql_test 4.0 {
|
|||||||
} {wal}
|
} {wal}
|
||||||
faultsim_save_and_close
|
faultsim_save_and_close
|
||||||
|
|
||||||
do_test 4.1 {
|
do_test 4.0.1 {
|
||||||
faultsim_restore_and_reopen
|
faultsim_restore_and_reopen
|
||||||
db eval { SELECT * FROM sqlite_master }
|
db eval { SELECT * FROM sqlite_master }
|
||||||
sqlite3_snapshot_recover db main
|
sqlite3_snapshot_recover db main
|
||||||
} {}
|
} {}
|
||||||
db close
|
db close
|
||||||
|
|
||||||
do_faultsim_test 4 -faults oom* -prep {
|
do_faultsim_test 4.0 -faults oom* -prep {
|
||||||
faultsim_restore_and_reopen
|
faultsim_restore_and_reopen
|
||||||
db eval { SELECT * FROM sqlite_master }
|
db eval { SELECT * FROM sqlite_master }
|
||||||
} -body {
|
} -body {
|
||||||
@@ -191,5 +187,40 @@ do_faultsim_test 4 -faults oom* -prep {
|
|||||||
faultsim_test_result {0 {}} {1 SQLITE_NOMEM} {1 SQLITE_IOERR_NOMEM}
|
faultsim_test_result {0 {}} {1 SQLITE_NOMEM} {1 SQLITE_IOERR_NOMEM}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# The following test cases contrive to call sqlite3_snapshot_recover()
|
||||||
|
# before all pages of the *-shm file have been mapped. This tests an
|
||||||
|
# extra branch of error handling logic in snapshot_recover().
|
||||||
|
#
|
||||||
|
reset_db
|
||||||
|
do_execsql_test 4.1.0 {
|
||||||
|
PRAGMA page_size = 512;
|
||||||
|
PRAGMA journal_mode = wal;
|
||||||
|
PRAGMA wal_autocheckpoint = 0;
|
||||||
|
CREATE TABLE t1(zzz);
|
||||||
|
INSERT INTO t1 VALUES(randomblob( 500 * 9500 ));
|
||||||
|
PRAGMA user_version = 211;
|
||||||
|
} {wal 0}
|
||||||
|
|
||||||
|
do_test 4.1.1 {
|
||||||
|
list [file size test.db-shm] [file size test.db]
|
||||||
|
} {98304 512}
|
||||||
|
|
||||||
|
faultsim_save_and_close
|
||||||
|
do_faultsim_test 4.1 -faults shm* -prep {
|
||||||
|
catch { db2 close }
|
||||||
|
catch { db close }
|
||||||
|
faultsim_restore_and_reopen
|
||||||
|
sqlite3 db2 test.db
|
||||||
|
db2 eval { SELECT * FROM sqlite_master }
|
||||||
|
db eval BEGIN
|
||||||
|
sqlite3_snapshot_get_blob db main
|
||||||
|
db eval COMMIT
|
||||||
|
} -body {
|
||||||
|
sqlite3_snapshot_recover db main
|
||||||
|
} -test {
|
||||||
|
faultsim_test_result {0 {}} {1 SQLITE_IOERR}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
finish_test
|
finish_test
|
||||||
|
Reference in New Issue
Block a user