Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Side by Side Diff: third_party/sqlite/src/test/walshared.test

Issue 6990047: Import SQLite 3.7.6.3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/sqlite/src/test/walnoshm.test ('k') | third_party/sqlite/src/test/walslow.test » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # 2010 August 2
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 the operation of the library in
13 # "PRAGMA journal_mode=WAL" mode with shared-cache turned on.
14 #
15
16 set testdir [file dirname $argv0]
17 source $testdir/tester.tcl
18
19 ifcapable !wal {finish_test ; return }
20
21 db close
22 set ::enable_shared_cache [sqlite3_enable_shared_cache 1]
23
24 sqlite3 db test.db
25 sqlite3 db2 test.db
26
27 do_test walshared-1.0 {
28 execsql {
29 PRAGMA cache_size = 10;
30 PRAGMA journal_mode = WAL;
31 CREATE TABLE t1(a PRIMARY KEY, b UNIQUE);
32 INSERT INTO t1 VALUES(randomblob(100), randomblob(200));
33 }
34 } {wal}
35
36 do_test walshared-1.1 {
37 execsql {
38 BEGIN;
39 INSERT INTO t1 VALUES(randomblob(100), randomblob(200));
40 INSERT INTO t1 SELECT randomblob(100), randomblob(200) FROM t1;
41 INSERT INTO t1 SELECT randomblob(100), randomblob(200) FROM t1;
42 INSERT INTO t1 SELECT randomblob(100), randomblob(200) FROM t1;
43 }
44 } {}
45
46 do_test walshared-1.2 {
47 catchsql { PRAGMA wal_checkpoint }
48 } {1 {database table is locked}}
49
50 do_test walshared-1.3 {
51 catchsql { PRAGMA wal_checkpoint } db2
52 } {1 {database table is locked}}
53
54 do_test walshared-1.4 {
55 execsql { COMMIT }
56 execsql { PRAGMA integrity_check } db2
57 } {ok}
58
59
60
61 sqlite3_enable_shared_cache $::enable_shared_cache
62 finish_test
63
OLDNEW
« no previous file with comments | « third_party/sqlite/src/test/walnoshm.test ('k') | third_party/sqlite/src/test/walslow.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698