From: dan Date: Mon, 25 Sep 2017 09:37:37 +0000 (+0000) Subject: Add an extra snapshot related test case. X-Git-Tag: version-3.21.0~61 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b92d585c60bc764b6b0dd28de01b9e656a309c17;p=thirdparty%2Fsqlite.git Add an extra snapshot related test case. FossilOrigin-Name: 24a95e143785bb8e12198092d13c979ec2e116fa8b55d0bf482cb473a92294d8 --- diff --git a/manifest b/manifest index 1938515870..01453b7f66 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Use\sthe\supdated\sWin32\sVFS\ssemantics\sfor\swinOpen\sfrom\scheck-in\s[5d03c738e9]\sfor\sWinRT,\set\sal,\sas\swell. -D 2017-09-22T16:23:23.946 +C Add\san\sextra\ssnapshot\srelated\stest\scase. +D 2017-09-25T09:37:37.738 F Makefile.in 4bc36d913c2e3e2d326d588d72f618ac9788b2fd4b7efda61102611a6495c3ff F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 6033b51b6aea702ea059f6ab2d47b1d3cef648695f787247dd4fb395fe60673f @@ -1205,7 +1205,7 @@ F test/skipscan3.test ec5bab3f81c7038b43450e7b3062e04a198bdbb5 F test/skipscan5.test 67817a4b6857c47e0e33ba3e506da6f23ef68de2 F test/skipscan6.test 5866039d03a56f5bd0b3d172a012074a1d90a15b F test/snapshot.test 85735bd997a4f6d710140c28fd860519a299649f -F test/snapshot2.test 867652ed4a13282dce218723535fad1c7b44c3c4 +F test/snapshot2.test 925e42427e923262db63c9d7155183f889e3e99feaedec4075f659e51608344f F test/snapshot_fault.test 52c5e97ebd218846a8ae2da4d147d3e77d71f963 F test/soak.test 0b5b6375c9f4110c828070b826b3b4b0bb65cd5f F test/softheap1.test 843cd84db9891b2d01b9ab64cef3e9020f98d087 @@ -1655,7 +1655,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 403b88a894d877b85bcc33133abad06c3c576e4928de4a4b0c091f74c4015355 -R 7f08f0df04c939d1dd5a187c9ae3cc49 -U mistachkin -Z 321f82ff3326ba269549cfe661409f34 +P 2c03d8b8f028b6a736aaf2cf8b28a51b3434cf341c95cf3a80469e0a24acdd98 +R e3a6bb3c09ba5319582a3c2241441527 +U dan +Z 02534471970367b2995d58c98bf3758e diff --git a/manifest.uuid b/manifest.uuid index 04153e1aac..23a21dc119 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2c03d8b8f028b6a736aaf2cf8b28a51b3434cf341c95cf3a80469e0a24acdd98 \ No newline at end of file +24a95e143785bb8e12198092d13c979ec2e116fa8b55d0bf482cb473a92294d8 \ No newline at end of file diff --git a/test/snapshot2.test b/test/snapshot2.test index 41e555258b..3faabd7f4c 100644 --- a/test/snapshot2.test +++ b/test/snapshot2.test @@ -197,4 +197,45 @@ do_test 4.7 { list [catch { sqlite3_snapshot_recover db aux } msg] $msg } {1 SQLITE_ERROR} +#------------------------------------------------------------------------- +reset_db +sqlite3 db2 test.db +do_execsql_test 5.0 { + CREATE TABLE t2(x); + PRAGMA journal_mode = wal; + INSERT INTO t2 VALUES('abc'); + INSERT INTO t2 VALUES('def'); + INSERT INTO t2 VALUES('ghi'); +} {wal} + +do_test 5.1 { + execsql { + SELECT * FROM t2; + BEGIN; + } db2 + set snap [sqlite3_snapshot_get_blob db2 main] + db2 eval END +} {} + +do_test 5.2 { + execsql BEGIN db2 + sqlite3_snapshot_open_blob db2 main $snap + db2 eval { SELECT * FROM t2 ; END } +} {abc def ghi} + +do_test 5.3 { + execsql { PRAGMA wal_checkpoint = RESTART } + execsql BEGIN db2 + sqlite3_snapshot_open_blob db2 main $snap + db2 eval { SELECT * FROM t2 ; END } +} {abc def ghi} + +do_test 5.4 { + execsql { INSERT INTO t2 VALUES('jkl') } + execsql BEGIN db2 + list [catch { sqlite3_snapshot_open_blob db2 main $snap } msg] $msg +} {1 SQLITE_BUSY_SNAPSHOT} + + finish_test +