xref: /sqlite-3.40.0/test/tkt3761.test (revision 86655a1d)
1# 2009 March 30
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#
12# Ticket #3761:  Make sure that an incremental vacuum on an in-memory
13# database can be rolled back.
14#
15# $Id: tkt3761.test,v 1.1 2009/03/31 02:54:40 drh Exp $
16
17set testdir [file dirname $argv0]
18source $testdir/tester.tcl
19
20do_test tkt3761-1.1 {
21  db close
22  sqlite3 db :memory:
23  db eval {
24    PRAGMA auto_vacuum=INCREMENTAL;
25    CREATE TABLE t1(x);
26    INSERT INTO t1 VALUES(zeroblob(900));
27    INSERT INTO t1 VALUES(zeroblob(900));
28    INSERT INTO t1 SELECT x FROM t1;
29    INSERT INTO t1 SELECT x FROM t1;
30    INSERT INTO t1 SELECT x FROM t1;
31    INSERT INTO t1 SELECT x FROM t1;
32    BEGIN;
33    DELETE FROM t1 WHERE rowid%2;
34    PRAGMA incremental_vacuum(4);
35    ROLLBACK;
36  }
37  db eval {PRAGMA integrity_check}
38} {ok}
39
40finish_test
41