/ Check-in [85a376fc]
Login

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

Overview
Comment:Add new test file wal2rollback.test to this branch.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | wal2
Files: files | file ages | folders
SHA3-256:85a376fc6c77117b96814df800b3d68a441d69602ffc2eb8cd7dba29f25d69aa
User & Date: dan 2018-12-28 16:20:53
Wiki:wal2
Context
2019-01-02
16:15
Merge latest trunk changes into this branch. check-in: 87ef68f9 user: dan tags: wal2
2018-12-28
16:20
Add new test file wal2rollback.test to this branch. check-in: 85a376fc user: dan tags: wal2
2018-12-27
16:49
Increase test coverage of wal.c provided by permutation "coverage-wal" on this branch. check-in: 2f7f893a user: dan tags: wal2
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added test/wal2rollback.test.





























































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# 2017 September 19
#
# The author disclaims copyright to this source code.  In place of
# a legal notice, here is a blessing:
#
#    May you do good and not evil.
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this file is testing the operation of the library in
# "PRAGMA journal_mode=WAL2" mode.
#

set testdir [file dirname $argv0]
source $testdir/tester.tcl
source $testdir/lock_common.tcl
source $testdir/malloc_common.tcl
source $testdir/wal_common.tcl

set testprefix wal2rollback
ifcapable !wal {finish_test ; return }

do_execsql_test 1.0 {
  CREATE TABLE t1(a, b, c);
  CREATE TABLE t2(a, b, c);
  CREATE INDEX i1 ON t1(a);
  CREATE INDEX i2 ON t1(b);
  PRAGMA journal_mode = wal2;
  PRAGMA cache_size = 5;
  PRAGMA journal_size_limit = 10000;
  WITH s(i) AS (
    SELECT 1 UNION ALL SELECT i+1 FROM s LIMIT 1000
  )
  INSERT INTO t1 SELECT i, i, randomblob(200) FROM s;
} {wal2 10000}

do_test 1.1 {
  expr [file size test.db-wal] > 10000
} 1

do_test 1.2 {
  execsql {
    BEGIN;
      UPDATE t1 SET b=b+1;
      INSERT INTO t2 VALUES(1,2,3);
  }
  expr [file size test.db-wal2] > 10000
} {1}

breakpoint
do_execsql_test 1.3 {
  ROLLBACK;
  SELECT * FROM t2;
  SELECT count(*) FROM t1 WHERE a=b;
  PRAGMA integrity_check;
} {1000 ok}



finish_test