Remove a lot of the text describing extended format options from the
[sqlite.git] / test / cachespill.test
blob069251354fc43f750893eb1d4a076de2a57f87f7
1 # 2017 April 26
3 # The author disclaims copyright to this source code.  In place of
4 # a legal notice, here is a blessing:
6 #    May you do good and not evil.
7 #    May you find forgiveness for yourself and forgive others.
8 #    May you share freely, never taking more than you give.
10 #***********************************************************************
13 set testdir [file dirname $argv0]
14 source $testdir/tester.tcl
15 set testprefix cachespill
17 ifcapable !pager_pragmas {
18   finish_test
19   return
22 #-------------------------------------------------------------------------
23 # Test that "PRAGMA cache_spill = 0" completely disables cache spilling.
25 do_execsql_test 1.1 {
26   PRAGMA auto_vacuum = 0;
27   PRAGMA page_size = 1024;
28   PRAGMA cache_size = 100;
29   CREATE TABLE t1(a);
32 do_test 1.2 {
33   file size test.db
34 } {2048}
36 do_test 1.3 {
37   execsql {
38     BEGIN;
39       WITH s(i) AS (
40         SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<200
41       ) INSERT INTO t1 SELECT randomblob(900) FROM s;
42   }
43   expr {[file size test.db] > 50000}
44 } {1}
46 do_test 1.4 {
47   execsql ROLLBACK
48   file size test.db
49 } {2048}
51 do_test 1.5 {
52   execsql {
53     PRAGMA cache_spill = 0;
54     BEGIN;
55       WITH s(i) AS (
56         SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<200
57       ) INSERT INTO t1 SELECT randomblob(900) FROM s;
58   }
59   file size test.db
60 } {2048}
62 do_test 1.5 {
63   execsql {
64     ROLLBACK;
65     PRAGMA cache_spill = 1;
66     BEGIN;
67       WITH s(i) AS (
68         SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<200
69       ) INSERT INTO t1 SELECT randomblob(900) FROM s;
70   }
71   expr {[file size test.db] > 50000}
72 } {1}
74 do_execsql_test 1.6 { ROLLBACK }
77 finish_test