1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Add a test case that calls sqlite3_db_cacheflush() on an in-memory database.

FossilOrigin-Name: f0cdfb547b0976e753e94958f29cb294edf31bed
This commit is contained in:
dan
2015-10-29 20:57:06 +00:00
parent dbf6773e88
commit 4a6beac28b
3 changed files with 35 additions and 7 deletions

View File

@ -1,5 +1,5 @@
C Avoid\sautomatically\srolling\sback\sthe\stransaction\sif\san\sSQLITE_IOERR\sor\sSQLITE_FULL\serror\soccurs\swithin\ssqlite3_db_cacheflush(). C Add\sa\stest\scase\sthat\scalls\ssqlite3_db_cacheflush()\son\san\sin-memory\sdatabase.
D 2015-10-29T18:16:40.382 D 2015-10-29T20:57:06.654
F Makefile.in 2ea961bc09e441874eb3d1bf7398e04feb24f3ee F Makefile.in 2ea961bc09e441874eb3d1bf7398e04feb24f3ee
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc 702d3e98f3afc6587a78481257f3c4c900efc3a4 F Makefile.msc 702d3e98f3afc6587a78481257f3c4c900efc3a4
@ -503,7 +503,7 @@ F test/btree02.test fe69453d474d8154d19b904157ff1db4812fed99
F test/btreefault.test c2bcb542685eea44621275cfedbd8a13f65201e3 F test/btreefault.test c2bcb542685eea44621275cfedbd8a13f65201e3
F test/busy.test 76b4887f8b9160ba903c1ac22e8ff406ad6ae2f0 F test/busy.test 76b4887f8b9160ba903c1ac22e8ff406ad6ae2f0
F test/cache.test 13bc046b26210471ca6f2889aceb1ea52dc717de F test/cache.test 13bc046b26210471ca6f2889aceb1ea52dc717de
F test/cacheflush.test 95944e4210100c525ec301c060721e82210c33a5 F test/cacheflush.test 42855120d2b00ff75033b54ba7693927f1ce4de8
F test/capi2.test 011c16da245fdc0106a2785035de6b242c05e738 F test/capi2.test 011c16da245fdc0106a2785035de6b242c05e738
F test/capi3.test bf6f0308bbbba1e770dac13aa08e5c2ac61c7324 F test/capi3.test bf6f0308bbbba1e770dac13aa08e5c2ac61c7324
F test/capi3b.test efb2b9cfd127efa84433cd7a2d72ce0454ae0dc4 F test/capi3b.test efb2b9cfd127efa84433cd7a2d72ce0454ae0dc4
@ -1397,7 +1397,7 @@ F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P 65b86dc1fa4a57cc3cde86a820d9f848aa288a15 P 370b5d520c6523526988d0db5299f1bd09567782
R a2eb49b0b44e5f6d387cfe5db61ab944 R e469742ef6d00761a1fbbbbf9de3f4b1
U dan U dan
Z 0108dff3f79bd94c840ccf22fb26067f Z 9ba99da9a0f7b492a3cba8ddbf944bbf

View File

@ -1 +1 @@
370b5d520c6523526988d0db5299f1bd09567782 f0cdfb547b0976e753e94958f29cb294edf31bed

View File

@ -202,6 +202,34 @@ do_test 2.2.6 {
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14} } {1 2 3 4 5 6 7 8 9 10 11 12 13 14}
do_execsql_test 2.2.7 { COMMIT } 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 test_restore_config_pagecache
finish_test finish_test