aboutsummaryrefslogtreecommitdiff
path: root/test/pcache.test
diff options
context:
space:
mode:
authordanielk1977 <danielk1977@noemail.net>2009-05-08 06:52:47 +0000
committerdanielk1977 <danielk1977@noemail.net>2009-05-08 06:52:47 +0000
commitea24ac4b23b613e07f36d5ef1d578a44c4217669 (patch)
tree6c0ad63f4d9a820c1fc98415a2780d5c45f7f38e /test/pcache.test
parent79f02cef78847aa00f28edd80c8ebb6b171b4dc7 (diff)
downloadsqlite-ea24ac4b23b613e07f36d5ef1d578a44c4217669.tar.gz
sqlite-ea24ac4b23b613e07f36d5ef1d578a44c4217669.zip
Correctly update the cache page-count when discarding pages in the xTruncate() method of the default pcache implementation. Otherwise the effective configured size of the cache shrinks each time xTruncate() is called. Fix for #3844. (CVS 6619)
FossilOrigin-Name: 88211ceeec01ee0d3e55231512be26dd672db099
Diffstat (limited to 'test/pcache.test')
-rw-r--r--test/pcache.test23
1 files changed, 22 insertions, 1 deletions
diff --git a/test/pcache.test b/test/pcache.test
index 56e10fdea..7c0951e98 100644
--- a/test/pcache.test
+++ b/test/pcache.test
@@ -11,7 +11,7 @@
#
# This file is focused on testing the pcache module.
#
-# $Id: pcache.test,v 1.4 2009/03/05 14:59:40 danielk1977 Exp $
+# $Id: pcache.test,v 1.5 2009/05/08 06:52:48 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -145,4 +145,25 @@ do_test pcache-1.13 {
pcache_stats
} {current 15 max 15 min 10 recyclable 15}
+do_test pcache-1.14 {
+ hexio_write test.db 24 [hexio_render_int32 1000]
+ execsql { SELECT * FROM sqlite_master }
+ pcache_stats
+} {current 2 max 15 min 10 recyclable 2}
+
+do_test pcache-1.15 {
+ execsql {
+ SELECT * FROM t1 ORDER BY a; SELECT * FROM t1;
+ SELECT * FROM t2 ORDER BY a; SELECT * FROM t2;
+ SELECT * FROM t3 ORDER BY a; SELECT * FROM t3;
+ SELECT * FROM t4 ORDER BY a; SELECT * FROM t4;
+ SELECT * FROM t5 ORDER BY a; SELECT * FROM t5;
+ SELECT * FROM t6 ORDER BY a; SELECT * FROM t6;
+ SELECT * FROM t7 ORDER BY a; SELECT * FROM t7;
+ SELECT * FROM t8 ORDER BY a; SELECT * FROM t8;
+ SELECT * FROM t9 ORDER BY a; SELECT * FROM t9;
+ }
+ pcache_stats
+} {current 14 max 15 min 10 recyclable 14}
+
finish_test