/ Check-in [1b1ad0b2]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add new test file vacuummem.test. To test that any temporary memory used by VACUUM is freed as soon as the VACUUM has finished (not, for example, when sqlite3_close() is finally called).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1b1ad0b28c392ade4321734e9b022a545b845b04
User & Date: dan 2016-07-21 16:43:54
Context
2016-07-21
18:02
Add extra test cases to verify the fix in [64ca1a835]. check-in: bf98a2de user: dan tags: trunk
16:43
Add new test file vacuummem.test. To test that any temporary memory used by VACUUM is freed as soon as the VACUUM has finished (not, for example, when sqlite3_close() is finally called). check-in: 1b1ad0b2 user: dan tags: trunk
2016-07-15
19:17
Add the largely untested SQLITE_FTS5_NO_WITHOUT_ROWID compile time option to fts5. For building a dynamically loadable extension that does not use WITHOUT ROWID. check-in: d0a1cf1c user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Added test/vacuummem.test.

            1  +# 2005 February 15
            2  +#
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
            5  +#
            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.
            9  +#
           10  +#***********************************************************************
           11  +# This file implements regression tests for SQLite library.  The
           12  +# focus of this file is testing that the VACUUM statement correctly
           13  +# frees any memory used for a temporary cache.
           14  +#
           15  +
           16  +set testdir [file dirname $argv0]
           17  +source $testdir/tester.tcl
           18  +set testprefix vacuummem
           19  +
           20  +proc memory_used {} { 
           21  +  set stat [sqlite3_status SQLITE_STATUS_MEMORY_USED 1]  
           22  +  lindex $stat 1
           23  +}
           24  +
           25  +do_execsql_test 1.0 {
           26  +  PRAGMA cache_size = -2000;
           27  +  CREATE TABLE t1(a, b, c);
           28  +
           29  +  WITH r(i) AS (
           30  +    SELECT 1 UNION ALL SELECT i+1 FROM r WHERE i<100000
           31  +  )
           32  +  INSERT INTO t1 SELECT randomblob(100),randomblob(100),randomblob(100) FROM r;
           33  +
           34  +  CREATE INDEX t1a ON t1(a);
           35  +  CREATE INDEX t1b ON t1(b);
           36  +  CREATE INDEX t1c ON t1(c);
           37  +}
           38  +
           39  +do_test 1.1 { memory_used } {#/2300000/}
           40  +
           41  +do_execsql_test 1.2 VACUUM
           42  +
           43  +do_test 1.3 { memory_used } {#/2300000/}
           44  +
           45  +do_execsql_test 1.4 {
           46  +  SELECT count(*) FROM t1 WHERE +a IS NOT NULL
           47  +} {100000}
           48  +
           49  +do_test 1.5 { memory_used } {#/2300000/}
           50  +
           51  +
           52  +
           53  +finish_test
           54  +