]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add a test case that calls sqlite3_db_cacheflush() on an in-memory database.
authordan <dan@noemail.net>
Thu, 29 Oct 2015 20:57:06 +0000 (20:57 +0000)
committerdan <dan@noemail.net>
Thu, 29 Oct 2015 20:57:06 +0000 (20:57 +0000)
FossilOrigin-Name: f0cdfb547b0976e753e94958f29cb294edf31bed

manifest
manifest.uuid
test/cacheflush.test

index 4ea95b624f4ca58d972b23b15e5ffa8593189a49..8aa65b5535e31580e937f988da3ba97827fab1c1 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Avoid\sautomatically\srolling\sback\sthe\stransaction\sif\san\sSQLITE_IOERR\sor\sSQLITE_FULL\serror\soccurs\swithin\ssqlite3_db_cacheflush().
-D 2015-10-29T18:16:40.382
+C Add\sa\stest\scase\sthat\scalls\ssqlite3_db_cacheflush()\son\san\sin-memory\sdatabase.
+D 2015-10-29T20:57:06.654
 F Makefile.in 2ea961bc09e441874eb3d1bf7398e04feb24f3ee
 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
 F Makefile.msc 702d3e98f3afc6587a78481257f3c4c900efc3a4
@@ -503,7 +503,7 @@ F test/btree02.test fe69453d474d8154d19b904157ff1db4812fed99
 F test/btreefault.test c2bcb542685eea44621275cfedbd8a13f65201e3
 F test/busy.test 76b4887f8b9160ba903c1ac22e8ff406ad6ae2f0
 F test/cache.test 13bc046b26210471ca6f2889aceb1ea52dc717de
-F test/cacheflush.test 95944e4210100c525ec301c060721e82210c33a5
+F test/cacheflush.test 42855120d2b00ff75033b54ba7693927f1ce4de8
 F test/capi2.test 011c16da245fdc0106a2785035de6b242c05e738
 F test/capi3.test bf6f0308bbbba1e770dac13aa08e5c2ac61c7324
 F test/capi3b.test efb2b9cfd127efa84433cd7a2d72ce0454ae0dc4
@@ -1397,7 +1397,7 @@ F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 65b86dc1fa4a57cc3cde86a820d9f848aa288a15
-R a2eb49b0b44e5f6d387cfe5db61ab944
+P 370b5d520c6523526988d0db5299f1bd09567782
+R e469742ef6d00761a1fbbbbf9de3f4b1
 U dan
-Z 0108dff3f79bd94c840ccf22fb26067f
+Z 9ba99da9a0f7b492a3cba8ddbf944bbf
index 114b47522f5d55d69f7e840819ec5aea76617b62..b806a0d73104cb51ebaa1d4d9fa1e5ea73cb094e 100644 (file)
@@ -1 +1 @@
-370b5d520c6523526988d0db5299f1bd09567782
\ No newline at end of file
+f0cdfb547b0976e753e94958f29cb294edf31bed
\ No newline at end of file
index a9ee672b9f238ae8d2eaedd078011bc1e1bfcd32..785bc0c77af97ba52db5a9af828b320747f9cb1e 100644 (file)
@@ -202,6 +202,34 @@ do_test 2.2.6 {
 } {1 2 3 4 5 6 7 8 9 10 11 12 13 14}
 do_execsql_test 2.2.7 { COMMIT }
 
+#-------------------------------------------------------------------------
+# Test that nothing terrible happens if sqlite3_db_cacheflush() is
+# called on an in-memory database.
+#
+do_test 3.0 {
+  db close
+  sqlite3 db :memory:
+  db eval {
+    CREATE TABLE t1(x PRIMARY KEY);
+    CREATE TABLE t2(y PRIMARY KEY);
+    BEGIN;
+      INSERT INTO t1 VALUES(randomblob(100));
+      INSERT INTO t2 VALUES(randomblob(100));
+      INSERT INTO t1 VALUES(randomblob(100));
+      INSERT INTO t2 VALUES(randomblob(100));
+  }
+  sqlite3_db_cacheflush db
+} {}
+
+do_execsql_test 3.1 { PRAGMA integrity_check } ok
+do_execsql_test 3.2 { COMMIT }
+do_execsql_test 3.3 { PRAGMA integrity_check } ok
+do_execsql_test 3.4 { 
+  SELECT count(*) FROM t1;
+  SELECT count(*) FROM t2;
+} {2 2}
+
+
 test_restore_config_pagecache
 finish_test