1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +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

@ -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