3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
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.
10 #***********************************************************************
11 # This file implements regression tests for SQLite library. Specifically,
12 # it tests that ticket [6bfb98dfc0]
14 # The final INSERT in the script below reports that the database is
15 # corrupt (SQLITE_CORRUPT) and aborts even though the database is not
18 # PRAGMA page_size=512;
19 # CREATE TABLE t1(x INTEGER PRIMARY KEY, y);
20 # INSERT INTO t1 VALUES(1,randomblob(400));
21 # INSERT INTO t1 VALUES(2,randomblob(400));
22 # INSERT INTO t1 SELECT x+2, randomblob(400) FROM t1;
23 # INSERT INTO t1 SELECT x+4, randomblob(400) FROM t1;
24 # INSERT INTO t1 SELECT x+8, randomblob(400) FROM t1;
25 # INSERT INTO t1 SELECT x+16, randomblob(400) FROM t1;
26 # INSERT INTO t1 SELECT x+32, randomblob(400) FROM t1;
27 # INSERT INTO t1 SELECT x+64, randomblob(400) FROM t1 WHERE x<10;
28 # CREATE TRIGGER r1 AFTER INSERT ON t1 WHEN new.x=74 BEGIN
30 # INSERT INTO t1 VALUES(75, randomblob(400));
31 # INSERT INTO t1 VALUES(76, randomblob(400));
33 # INSERT INTO t1 VALUES(74, randomblob(400));
36 set testdir [file dirname $argv0]
37 source $testdir/tester.tcl
39 do_test tkt-6bfb98dfc0.100 {
42 CREATE TABLE t1(x INTEGER PRIMARY KEY, y);
43 INSERT INTO t1 VALUES(1,randomblob(400));
44 INSERT INTO t1 VALUES(2,randomblob(400));
45 INSERT INTO t1 SELECT x+2, randomblob(400) FROM t1;
46 INSERT INTO t1 SELECT x+4, randomblob(400) FROM t1;
47 INSERT INTO t1 SELECT x+8, randomblob(400) FROM t1;
48 INSERT INTO t1 SELECT x+16, randomblob(400) FROM t1;
49 INSERT INTO t1 SELECT x+32, randomblob(400) FROM t1;
50 INSERT INTO t1 SELECT x+64, randomblob(400) FROM t1 WHERE x<10;
51 CREATE TRIGGER r1 AFTER INSERT ON t1 WHEN new.x=74 BEGIN
53 INSERT INTO t1 VALUES(75, randomblob(400));
54 INSERT INTO t1 VALUES(76, randomblob(400));
56 INSERT INTO t1 VALUES(74, randomblob(400));
57 SELECT x, length(y) FROM t1 ORDER BY x;