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 #***********************************************************************
13 source [file join [file dirname [info script]] fts5_common.tcl]
14 source $testdir/malloc_common.tcl
15 set testprefix fts5faultG
17 # If SQLITE_ENABLE_FTS5 is defined, omit this file.
23 set ::testprefix fts5faultH
25 sqlite3_fts5_register_origintext db
28 CREATE VIRTUAL TABLE t1 USING fts5(
29 x, tokenize="origintext unicode61", tokendata=1
33 INSERT INTO t1 VALUES('oNe tWo thRee');
34 INSERT INTO t1 VALUES('One Two Three');
35 INSERT INTO t1 VALUES('onE twO threE');
38 INSERT INTO t1 VALUES('one two three');
39 INSERT INTO t1 VALUES('one two three');
40 INSERT INTO t1 VALUES('one two three');
44 do_faultsim_test 1 -faults oom* -prep {
47 SELECT rowid FROM t1('three');
50 faultsim_integrity_check
51 faultsim_test_result {0 {1 2 3 4 5 6}}
56 sqlite3_fts5_register_origintext db
58 CREATE VIRTUAL TABLE t1 USING fts5(
59 x, tokenize="origintext unicode61", tokendata=1
61 INSERT INTO t1(t1, rank) VALUES('pgsz', 64);
64 INSERT INTO t1(rowid, x) VALUES(10, 'aaa bbb BBB');
65 INSERT INTO t1(rowid, x) VALUES(12, 'bbb bbb bbb');
66 INSERT INTO t1(rowid, x) VALUES(13, 'bbb bbb bbb');
67 INSERT INTO t1(rowid, x) VALUES(14, 'bbb BBB bbb');
68 INSERT INTO t1(rowid, x) VALUES(15, 'bbb bbb bbb');
69 INSERT INTO t1(rowid, x) VALUES(16, 'bbb bbb bbb');
70 INSERT INTO t1(rowid, x) VALUES(17, 'bbb bbb bbb');
71 INSERT INTO t1(rowid, x) VALUES(18, 'bbb bbb bbb');
72 INSERT INTO t1(rowid, x) VALUES(19, 'bbb bbb bbb');
73 INSERT INTO t1(rowid, x) VALUES(20, 'bbb bbb bbb');
74 INSERT INTO t1(rowid, x) VALUES(21, 'bbb bbb bbb');
75 INSERT INTO t1(rowid, x) VALUES(22, 'bbb bbb bbb');
76 INSERT INTO t1(rowid, x) VALUES(23, 'bbb bbb bbb');
77 INSERT INTO t1(rowid, x) VALUES(24, 'aaa bbb BBB');
81 do_faultsim_test 2 -faults oom* -prep {
84 SELECT rowid FROM t1('BBB AND AAA');
87 faultsim_integrity_check
88 faultsim_test_result {0 {10 24}}
92 sqlite3_fts5_register_origintext db
94 CREATE VIRTUAL TABLE t1 USING fts5(
95 x, tokenize="origintext unicode61", tokendata=1
97 INSERT INTO t1(t1, rank) VALUES('pgsz', 64);
99 INSERT INTO t1(rowid, x) VALUES(9, 'bbb Bbb BBB');
101 INSERT INTO t1(rowid, x) VALUES(10, 'aaa bbb BBB');
102 INSERT INTO t1(rowid, x) VALUES(11, 'bbb Bbb BBB');
103 INSERT INTO t1(rowid, x) VALUES(12, 'bbb Bbb BBB');
104 INSERT INTO t1(rowid, x) VALUES(13, 'bbb Bbb BBB');
105 INSERT INTO t1(rowid, x) VALUES(14, 'bbb Bbb BBB');
106 INSERT INTO t1(rowid, x) VALUES(15, 'bbb Bbb BBB');
107 INSERT INTO t1(rowid, x) VALUES(16, 'bbb Bbb BBB');
108 INSERT INTO t1(rowid, x) VALUES(17, 'bbb Bbb BBB');
109 INSERT INTO t1(rowid, x) VALUES(18, 'bbb Bbb BBB');
110 INSERT INTO t1(rowid, x) VALUES(19, 'bbb Bbb BBB');
111 INSERT INTO t1(rowid, x) VALUES(20, 'bbb Bbb BBB');
112 INSERT INTO t1(rowid, x) VALUES(21, 'bbb Bbb BBB');
113 INSERT INTO t1(rowid, x) VALUES(22, 'bbb Bbb BBB');
114 INSERT INTO t1(rowid, x) VALUES(23, 'bbb Bbb BBB');
115 INSERT INTO t1(rowid, x) VALUES(24, 'bbb Bbb BBB');
116 INSERT INTO t1(rowid, x) VALUES(25, 'bbb Bbb BBB');
117 INSERT INTO t1(rowid, x) VALUES(26, 'bbb Bbb BBB');
118 INSERT INTO t1(rowid, x) VALUES(27, 'bbb Bbb BBB');
119 INSERT INTO t1(rowid, x) VALUES(28, 'bbb Bbb BBB');
120 INSERT INTO t1(rowid, x) VALUES(29, 'bbb Bbb BBB');
121 INSERT INTO t1(rowid, x) VALUES(30, 'bbb Bbb BBB');
122 INSERT INTO t1(rowid, x) VALUES(31, 'bbb Bbb BBB');
123 INSERT INTO t1(rowid, x) VALUES(32, 'bbb Bbb BBB');
124 INSERT INTO t1(rowid, x) VALUES(33, 'bbb Bbb BBB');
125 INSERT INTO t1(rowid, x) VALUES(34, 'bbb Bbb BBB');
126 INSERT INTO t1(rowid, x) VALUES(35, 'aaa bbb BBB');
130 do_faultsim_test 3.1 -faults oom* -prep {
133 SELECT rowid FROM t1('BBB AND AAA');
136 faultsim_integrity_check
137 faultsim_test_result {0 {10 35}}
139 do_faultsim_test 3.2 -faults oom* -prep {
142 SELECT count(*) FROM t1('BBB');
145 faultsim_integrity_check
146 faultsim_test_result {0 27}