1 /* Test cases involving incomplete transactions that must be rolled back.
4 DROP TABLE IF EXISTS t1;
5 CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
7 INSERT INTO t1 VALUES(1, randomblob(2000));
8 INSERT INTO t1 VALUES(2, randomblob(1000));
10 INSERT INTO t1 SELECT a+2, randomblob(1500) FROM t1;
11 INSERT INTO t1 SELECT a+4, randomblob(1500) FROM t1;
12 INSERT INTO t1 SELECT a+8, randomblob(1500) FROM t1;
14 INSERT INTO t1 SELECT a+16, randomblob(1500) FROM t1;
16 INSERT INTO t1 SELECT a+32, randomblob(1500) FROM t1;
17 SELECT count(*) FROM t1;
19 SELECT avg(length(b)) FROM t1;
22 UPDATE t1 SET b='x'||a||'y';
23 SELECT sum(length(b)) FROM t1;
25 SELECT a FROM t1 WHERE b='x17y';
27 CREATE INDEX t1b ON t1(b);
28 SELECT a FROM t1 WHERE b='x17y';
30 SELECT a FROM t1 WHERE b GLOB 'x2?y' ORDER BY b DESC LIMIT 5;
31 --match 29 28 27 26 25
35 CREATE TABLE t2(a INTEGER PRIMARY KEY, b);
36 INSERT INTO t2 SELECT a, b FROM t1;
37 UPDATE t1 SET b='x'||a||'y';
38 SELECT sum(length(b)) FROM t2;
40 SELECT a FROM t2 WHERE b='x17y';
42 CREATE INDEX t2b ON t2(b);
43 SELECT a FROM t2 WHERE b='x17y';
45 SELECT a FROM t2 WHERE b GLOB 'x2?y' ORDER BY b DESC LIMIT 5;
46 --match 29 28 27 26 25
49 CREATE TABLE t3(a INTEGER PRIMARY KEY, b);
50 INSERT INTO t3 SELECT a, b FROM t1;
51 UPDATE t1 SET b='x'||a||'y';
52 SELECT sum(length(b)) FROM t3;
54 SELECT a FROM t3 WHERE b='x17y';
56 CREATE INDEX t3b ON t3(b);
57 SELECT a FROM t3 WHERE b='x17y';
59 SELECT a FROM t3 WHERE b GLOB 'x2?y' ORDER BY b DESC LIMIT 5;
60 --match 29 28 27 26 25
63 CREATE TABLE t4(a INTEGER PRIMARY KEY, b);
64 INSERT INTO t4 SELECT a, b FROM t1;
65 UPDATE t1 SET b='x'||a||'y';
66 SELECT sum(length(b)) FROM t4;
68 SELECT a FROM t4 WHERE b='x17y';
70 CREATE INDEX t4b ON t4(b);
71 SELECT a FROM t4 WHERE b='x17y';
73 SELECT a FROM t4 WHERE b GLOB 'x2?y' ORDER BY b DESC LIMIT 5;
74 --match 29 28 27 26 25
77 CREATE TABLE t5(a INTEGER PRIMARY KEY, b);
78 INSERT INTO t5 SELECT a, b FROM t1;
79 UPDATE t1 SET b='x'||a||'y';
80 SELECT sum(length(b)) FROM t5;
82 SELECT a FROM t5 WHERE b='x17y';
84 CREATE INDEX t5b ON t5(b);
85 SELECT a FROM t5 WHERE b='x17y';
87 SELECT a FROM t5 WHERE b GLOB 'x2?y' ORDER BY b DESC LIMIT 5;
88 --match 29 28 27 26 25
92 /* After the database file has been set up, run the crash2 subscript
94 --source crash02.subtest
95 --source crash02.subtest
96 --source crash02.subtest
97 --source crash02.subtest
98 --source crash02.subtest
99 --source crash02.subtest
100 --source crash02.subtest
101 --source crash02.subtest
102 --source crash02.subtest