Annotation of embedaddon/sqlite3/test/crash7.test, revision 1.1.1.1
1.1 misho 1: # 2008 March 20
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: #
12: # $Id: crash7.test,v 1.1 2008/04/03 14:36:26 danielk1977 Exp $
13:
14: set testdir [file dirname $argv0]
15: source $testdir/tester.tcl
16:
17: ifcapable !crashtest {
18: finish_test
19: return
20: }
21:
22: proc signature {} {
23: return [db eval {SELECT count(*), md5sum(a), md5sum(b), md5sum(c) FROM abc}]
24: }
25:
26: foreach f [list test.db test.db-journal] {
27: for {set ii 1} {$ii < 64} {incr ii} {
28: db close
29: delete_file test.db
30: sqlite3 db test.db
31:
32: set from_size [expr 1024 << ($ii&3)]
33: set to_size [expr 1024 << (($ii>>2)&3)]
34:
35: execsql "
36: PRAGMA page_size = $from_size;
37: BEGIN;
38: CREATE TABLE abc(a PRIMARY KEY, b, c);
39: INSERT INTO abc VALUES(randomblob(100), randomblob(200), randomblob(1000));
40: INSERT INTO abc
41: SELECT randomblob(1000), randomblob(200), randomblob(100)
42: FROM abc;
43: INSERT INTO abc
44: SELECT randomblob(100), randomblob(200), randomblob(1000)
45: FROM abc;
46: INSERT INTO abc
47: SELECT randomblob(100), randomblob(200), randomblob(1000)
48: FROM abc;
49: INSERT INTO abc
50: SELECT randomblob(100), randomblob(200), randomblob(1000)
51: FROM abc;
52: INSERT INTO abc
53: SELECT randomblob(100), randomblob(200), randomblob(1000)
54: FROM abc WHERE [expr $ii&16];
55: INSERT INTO abc
56: SELECT randomblob(25), randomblob(45), randomblob(9456)
57: FROM abc WHERE [expr $ii&32];
58: INSERT INTO abc
59: SELECT randomblob(100), randomblob(200), randomblob(1000)
60: FROM abc WHERE [expr $ii&8];
61: INSERT INTO abc
62: SELECT randomblob(25), randomblob(45), randomblob(9456)
63: FROM abc WHERE [expr $ii&4];
64: COMMIT;
65: "
66:
67: set sig [signature]
68: db close
69:
70: do_test crash7-1.$ii.crash {
71: crashsql -file $f "
72: PRAGMA page_size = $to_size;
73: VACUUM;
74: "
75: } {1 {child process exited abnormally}}
76:
77: sqlite3 db test.db
78: integrity_check crash7-1.$ii.integrity
79: }
80: }
81:
82: finish_test
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>