xref: /sqlite-3.40.0/mptest/crash02.subtest (revision 7de96f7f)
1/*
2** This script is called from crash01.test and config02.test and perhaps other
3** script.  After the database file has been set up, make a big rollback
4** journal in client 1, then crash client 1.
5** Then in the other clients, do an integrity check.
6*/
7--task 1
8  --sleep 5
9  --finish
10  PRAGMA cache_size=10;
11  BEGIN;
12  UPDATE t1 SET b=randomblob(20000);
13  UPDATE t2 SET b=randomblob(20000);
14  UPDATE t3 SET b=randomblob(20000);
15  UPDATE t4 SET b=randomblob(20000);
16  UPDATE t5 SET b=randomblob(20000);
17  UPDATE t1 SET b=NULL;
18  UPDATE t2 SET b=NULL;
19  UPDATE t3 SET b=NULL;
20  UPDATE t4 SET b=NULL;
21  UPDATE t5 SET b=NULL;
22  --print Task one crashing an incomplete transaction
23  --exit 1
24--end
25--task 2
26  SELECT count(*) FROM t1;
27  --match 64
28  --sleep 100
29  PRAGMA integrity_check(10);
30  --output
31  --match ok
32--end
33--task 3
34  SELECT count(*) FROM t1;
35  --match 64
36  --sleep 100
37  PRAGMA integrity_check(10);
38  --output
39  --match ok
40--end
41--task 4
42  SELECT count(*) FROM t1;
43  --match 64
44  --sleep 100
45  PRAGMA integrity_check(10);
46  --output
47  --match ok
48--end
49--task 5
50  SELECT count(*) FROM t1;
51  --match 64
52  --sleep 100
53  PRAGMA integrity_check(10);
54  --output
55  --match ok
56--end
57--wait all
58