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 DROP TABLE IF EXISTS t2;
36 CREATE TABLE t2(a INTEGER PRIMARY KEY, b);
37 INSERT INTO t2 SELECT a, b FROM t1;
38 UPDATE t1 SET b='x'||a||'y';
39 SELECT sum(length(b)) FROM t2;
41 SELECT a FROM t2 WHERE b='x17y';
43 CREATE INDEX t2b ON t2(b);
44 SELECT a FROM t2 WHERE b='x17y';
46 SELECT a FROM t2 WHERE b GLOB 'x2?y' ORDER BY b DESC LIMIT 5;
47 --match 29 28 27 26 25
50 DROP TABLE IF EXISTS t3;
51 CREATE TABLE t3(a INTEGER PRIMARY KEY, b);
52 INSERT INTO t3 SELECT a, b FROM t1;
53 UPDATE t1 SET b='x'||a||'y';
54 SELECT sum(length(b)) FROM t3;
56 SELECT a FROM t3 WHERE b='x17y';
58 CREATE INDEX t3b ON t3(b);
59 SELECT a FROM t3 WHERE b='x17y';
61 SELECT a FROM t3 WHERE b GLOB 'x2?y' ORDER BY b DESC LIMIT 5;
62 --match 29 28 27 26 25
65 DROP TABLE IF EXISTS t4;
66 CREATE TABLE t4(a INTEGER PRIMARY KEY, b);
67 INSERT INTO t4 SELECT a, b FROM t1;
68 UPDATE t1 SET b='x'||a||'y';
69 SELECT sum(length(b)) FROM t4;
71 SELECT a FROM t4 WHERE b='x17y';
73 CREATE INDEX t4b ON t4(b);
74 SELECT a FROM t4 WHERE b='x17y';
76 SELECT a FROM t4 WHERE b GLOB 'x2?y' ORDER BY b DESC LIMIT 5;
77 --match 29 28 27 26 25
80 DROP TABLE IF EXISTS t5;
81 CREATE TABLE t5(a INTEGER PRIMARY KEY, b);
82 INSERT INTO t5 SELECT a, b FROM t1;
83 UPDATE t1 SET b='x'||a||'y';
84 SELECT sum(length(b)) FROM t5;
86 SELECT a FROM t5 WHERE b='x17y';
88 CREATE INDEX t5b ON t5(b);
89 SELECT a FROM t5 WHERE b='x17y';
91 SELECT a FROM t5 WHERE b GLOB 'x2?y' ORDER BY b DESC LIMIT 5;
92 --match 29 28 27 26 25
96 /* After the database file has been set up, run the crash2 subscript
98 --source crash02.subtest
99 --source crash02.subtest
100 --source crash02.subtest
101 --source crash02.subtest
102 --source crash02.subtest
103 --source crash02.subtest
104 --source crash02.subtest
105 --source crash02.subtest
106 --source crash02.subtest