SQLite

Check-in [c5fb7d6a10]
Login

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

Overview
Comment:Adding test cases for the "PRAGMA data_version" command.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | data_version_pragma
Files: files | file ages | folders
SHA1: c5fb7d6a106d46f10e71abe3a6d4243b21ed02a5
User & Date: drh 2014-12-19 20:27:02.112
Context
2014-12-20
14:34
Update the PRAGMA data_version command so that it reponse to changes made by a shared-cache database connection, and also to changes made by the same database connection. Add test cases to verify the new behavior. (Closed-Leaf check-in: 44ee538374 user: drh tags: data_version_pragma)
2014-12-19
20:27
Adding test cases for the "PRAGMA data_version" command. (check-in: c5fb7d6a10 user: drh tags: data_version_pragma)
19:28
Experimental "PRAGMA data_version" command for detecting when another process has changed the database file. (check-in: 43db1f44bc user: drh tags: data_version_pragma)
Changes
Unified Diff Ignore Whitespace Patch
Added test/pragma3.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
63
64
65
66
67
68
69
70
# 2014-12-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.
#
# This file implements tests for PRAGMA data_version command.
#

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

do_execsql_test pragma3-100 {
  PRAGMA data_version;
} {1}
do_execsql_test pragma3-101 {
  PRAGMA temp.data_version;
} {1}

# Writing is a no-op 
do_execsql_test pragma3-102 {
  PRAGMA main.data_version=1234;
  PRAGMA main.data_version;
} {1 1}

do_execsql_test pragma3-110 {
  CREATE TABLE t1(a);
  INSERT INTO t1 VALUES(100),(200),(300);
  SELECT * FROM t1;
  PRAGMA data_version;
} {100 200 300 1}

sqlite3 db2 test.db
do_test pragma3-120 {
  db2 eval {
    SELECT * FROM t1;
    PRAGMA data_version;
  }
} {100 200 300 1}

do_execsql_test pragma3-130 {
  INSERT INTO t1 VALUES(400),(500);
  SELECT * FROM t1;
  PRAGMA data_version;
} {100 200 300 400 500 1}

do_test pragma3-140 {
  db2 eval {
    SELECT * FROM t1;
    PRAGMA data_version;
    UPDATE t1 SET a=a+1;
    SELECT * FROM t1;
    PRAGMA data_version;
  }
} {100 200 300 400 500 2 101 201 301 401 501 2}

do_execsql_test pragma3-150 {
  SELECT * FROM t1;
  PRAGMA data_version;
} {101 201 301 401 501 2}


db2 close
finish_test