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 #***********************************************************************
12 set testdir [file dirname $argv0]
13 source $testdir/tester.tcl
14 source $testdir/malloc_common.tcl
16 ifcapable !fts3||!fts4_deferred {
21 set sqlite_fts3_enable_parentheses 1
23 set fts3_simple_deferred_tokens_only 1
25 set ::testprefix fts3defer
27 #--------------------------------------------------------------------------
28 # Test cases fts3defer-1.* are the "warm body" cases. The database contains
29 # one row with 15000 instances of the token "a". This makes the doclist for
30 # "a" so large that FTS3 will avoid loading it in most cases.
32 # To show this, test cases fts3defer-1.2.* execute a bunch of FTS3 queries
33 # involving token "a". Then, fts3defer-1.3.* replaces the doclist for token
34 # "a" with all zeroes and fts3defer-1.4.* repeats the tests from 1.2. If
35 # the tests still work, we can conclude that the doclist for "a" was not
39 set aaa [string repeat "a " 15000]
42 CREATE VIRTUAL TABLE t1 USING fts4;
44 INSERT INTO t1 VALUES('this is a dog');
45 INSERT INTO t1 VALUES('an instance of a phrase');
46 INSERT INTO t1 VALUES('an instance of a longer phrase');
47 INSERT INTO t1 VALUES($aaa);
52 1 {SELECT rowid FROM t1 WHERE t1 MATCH '"a dog"'} {1}
53 2 {SELECT rowid FROM t1 WHERE t1 MATCH '"is a dog"'} {1}
54 3 {SELECT rowid FROM t1 WHERE t1 MATCH '"a longer phrase"'} {3}
55 4 {SELECT snippet(t1) FROM t1 WHERE t1 MATCH '"a longer phrase"'}
56 {"an instance of <b>a</b> <b>longer</b> <b>phrase</b>"}
57 5 {SELECT rowid FROM t1 WHERE t1 MATCH 'a dog'} {1}
60 do_select_tests 1.2 $tests
63 SELECT count(*) FROM t1_segments WHERE length(block)>10000;
65 SET block = zeroblob(length(block))
66 WHERE length(block)>10000;
69 do_select_tests 1.4 $tests
71 # Drop the table. It is corrupt now anyhow, so not useful for subsequent tests.
73 do_execsql_test 1.5 { DROP TABLE t1 }
75 #--------------------------------------------------------------------------
76 # These tests - fts3defer-2.* - are more rigorous. They test that for a
77 # variety of queries, FTS3 and FTS4 return the same results. And that
78 # zeroing the very large doclists that FTS4 does not load does not change
81 # They use the following pseudo-randomly generated document data. The
82 # tokens "zm" and "jk" are especially common in this dataset. Additionally,
83 # two documents are added to the pseudo-random data before it is loaded
84 # into FTS4 containing 100,000 instances of the "zm" and "jk" tokens. This
85 # makes the doclists for those tokens so large that FTS4 avoids loading them
86 # into memory if possible.
89 lappend data [string repeat "zm " 100000]
90 lappend data [string repeat "jk " 100000]
92 "zm zm agmckuiu uhzq nsab jk rrkx duszemmzl hyq jk"
93 "jk uhzq zm zm rgpzmlnmd zm zk jk jk zm"
94 "duszemmzl zm jk xldlpy zm jk sbptoa xh jk xldlpy"
95 "zm xh zm xqf azavwm jk jk trqd rgpzmlnmd jk"
96 "zm vwq urvysbnykk ubwrfqnbjf zk lsz jk doiwavhwwo jk jk"
97 "jk xduvfhk orpfawpx zkhdvkw jk mjpavjuhw zm jk duszemmzl zm"
98 "jk igju jk jk zm hmjf xh zm gwdfhwurx zk"
99 "vgsld jk jk zm hrlipdm jn zm zsmhnf vgsld duszemmzl"
100 "gtuiexzsu aayxpmve zm zm zm drir scpgna xh azavwm uhzq"
101 "farlehdhq hkfoudzftq igju duszemmzl xnxhf ewle zm hrlipdm urvysbnykk kn"
102 "xnxhf jk jk agmckuiu duszemmzl jk zm zm jk vgsld"
103 "zm zm zm jk jk urvysbnykk ogttbykvt zm zm jk"
104 "iasrqgqv zm azavwm zidhxhbtv jk jk mjpavjuhw zm zm ajmvcydy"
105 "rgpzmlnmd tmt mjpavjuhw xh igju jk azavwm fibokdry vgsld ofm"
106 "zm jk vgsld jk xh jk csjqxhgj drir jk pmrb"
107 "xh jk jk zm rrkx duszemmzl mjpavjuhw xldlpy igju zm"
108 "jk hkfoudzftq zf rrkx wdmy jupk jk zm urvysbnykk npywgdvgz"
109 "zm jk zm zm zhbrzadb uenvbm aayxpmve urvysbnykk duszemmzl jk"
110 "uenvbm jk zm fxw xh bdilwmjw mjpavjuhw uv jk zm"
111 "nk jk bnhc pahlds jk igju dzadnqzprr jk jk jk"
112 "uhzq uv zm duszemmzl tlqix jk jk xh jk zm"
113 "jk zm agmckuiu urvysbnykk jk jk zm zm jk jk"
114 "azavwm mjpavjuhw lsgshn trqd xldlpy ogyavjvv agmckuiu ryvwwhlbc jk jk"
115 "tmt jk zk zm azavwm ofm acpgim bvgimjik iasrqgqv wuvajhwqz"
116 "igju ogyavjvv xrbdak rrkx fibokdry zf ujfhmrllq jk zm hxgwvib"
117 "zm pahlds jk uenvbm aayxpmve iaf hmjf xph vnlyvtkgx zm"
118 "jk xnxhf igju jk xh jk nvfasfh zm js jk"
119 "zm zm rwaj igju xr rrkx xnxhf nvfasfh skxbsqzvmt xatbxeqq"
120 "vgsld zm ujfhmrllq uhzq ogyavjvv nsab azavwm zm vgsld jmfiqhwnjg"
121 "ymjoym duszemmzl urvysbnykk azavwm jk jmfiqhwnjg bu qcdziqomqk vnlyvtkgx"
122 "zm nbilqcnz dzadnqzprr xh bkfgzsxn urvysbnykk xrujfzxqf zm zf agmckuiu"
123 "jk urvysbnykk nvfasfh zf xh zm zm qcdziqomqk qvxtclg wdmy"
124 "fibokdry jk urvysbnykk jk xr osff zm cvnnsl zm vgsld"
125 "jk mjpavjuhw hkfoudzftq jk zm xh xqf urvysbnykk jk iasrqgqv"
126 "jk csjqxhgj duszemmzl iasrqgqv aayxpmve zm brsuoqww jk qpmhtvl wluvgsw"
127 "jk mj azavwm jk zm jn dzadnqzprr zm jk uhzq"
128 "zk xqf jupk fxw nbilqcnz zm jk jcpiwj tznlvbfcv nvfasfh"
129 "jk jcpiwj zm xnxhf zm mjpavjuhw mj drir pa pvjrjlas"
130 "duszemmzl dzadnqzprr jk swc duszemmzl tmt jk jk pahlds jk"
131 "zk zm jk zm zm eczkjblu zm hi pmrb jk"
132 "azavwm zm iz agmckuiu jk sntk jk duszemmzl duszemmzl zm"
133 "jk zm jk eczkjblu urvysbnykk sk gnl jk ttvgf hmjf"
134 "jk bnhc jjrxpjkb mjpavjuhw fibokdry igju jk zm zm xh"
135 "wxe ogttbykvt uhzq xr iaf zf urvysbnykk aayxpmve oacaxgjoo mjpavjuhw"
136 "gazrt jk ephknonq myjp uenvbm wuvajhwqz jk zm xnxhf nvfasfh"
137 "zm aayxpmve csjqxhgj xnxhf xr jk aayxpmve xnxhf zm zm"
138 "sokcyf zm ogyavjvv jk zm fibokdry zm jk igju igju"
139 "vgsld bvgimjik xuprtlyle jk akmikrqyt jk aayxpmve hkfoudzftq ddjj ithtir"
140 "zm uhzq ovkyevlgv zk uenvbm csjqxhgj jk vgsld pgybs jk"
141 "zm agmckuiu zexh fibokdry jk uhzq bu tugflixoex xnxhf sk"
142 "zm zf uenvbm jk azavwm zm zm agmckuiu zm jk"
143 "rrkx jk zf jt zm oacaxgjoo fibokdry wdmy igju csjqxhgj"
144 "hi igju zm jk zidhxhbtv dzadnqzprr jk jk trqd duszemmzl"
145 "zm zm mjpavjuhw xrbdak qrvbjruc jk qzzqdxq guwq cvnnsl zm"
146 "ithtir jk jk qcdziqomqk zm farlehdhq zm zm xrbdak jk"
147 "ixfipk csjqxhgj azavwm sokcyf ttvgf vgsld jk sk xh zk"
148 "nvfasfh azavwm zm zm zm fxw nvfasfh zk gnl trqd"
149 "zm fibokdry csjqxhgj ofm dzadnqzprr jk akmikrqyt orpfawpx duszemmzl vwq"
150 "csjqxhgj jk jk vgsld urvysbnykk jk nxum jk jk nxum"
151 "zm hkfoudzftq jk ryvwwhlbc mjpavjuhw ephknonq jk zm ogyavjvv zm"
152 "lwa hi xnxhf qdyerbws zk njtc jk uhzq zm jk"
153 "trqd zm dzadnqzprr zm urvysbnykk jk lsz jk mjpavjuhw cmnnkna"
154 "duszemmzl zk jk jk fibokdry jseuhjnzo zm aayxpmve zk jk"
155 "fibokdry jk sviq qvxtclg wdmy jk doiwavhwwo zexh jk zm"
156 "jupk zm xh jk mjpavjuhw zm jk nsab npywgdvgz duszemmzl"
157 "zm igju zm zm nvfasfh eh hkfoudzftq fibokdry fxw xkblf"
158 "jk zm jk jk zm xh zk abthnzcv zf csjqxhgj"
159 "zm zm jk nkaotm urvysbnykk sbptoa bq jk ktxdty ubwrfqnbjf"
160 "nvfasfh aayxpmve xdcuz zm tugflixoex jcpiwj zm mjpavjuhw fibokdry doiwavhwwo"
161 "iaf jk mjpavjuhw zm duszemmzl jk jk uhzq pahlds fibokdry"
162 "ddjj zk azavwm jk swc zm gjtexkv jk xh jk"
163 "igju jk csjqxhgj zm jk dzadnqzprr duszemmzl ulvcbv jk jk"
164 "jk fibokdry zm csjqxhgj jn zm zm zm zf uhzq"
165 "duszemmzl jk xkblf zk hrlipdm aayxpmve uenvbm uhzq jk zf"
166 "dzadnqzprr jk zm zdu nvfasfh zm jk urvysbnykk hmjf jk"
167 "jk aayxpmve aserrdxm acpgim fibokdry jk drir wxe brsuoqww rrkx"
168 "uhzq csjqxhgj nvfasfh jk rrkx qbamok trqd uenvbm sntk zm"
169 "ps azavwm zkhdvkw jk zm jk jk zm csjqxhgj xedlrcfo"
170 "jk jk ogyavjvv jk zm farlehdhq duszemmzl jk agitgxamxe jk"
171 "qzzqdxq rwaj jk jk zm xqf jk uenvbm jk zk"
172 "zm hxgwvib akmikrqyt zf agmckuiu uenvbm bq npywgdvgz azavwm jk"
173 "zf jmfiqhwnjg js igju zm aayxpmve zm mbxnljomiv csjqxhgj nvfasfh"
174 "zm jk jk gazrt jk jk lkc jk nvfasfh jk"
175 "xldlpy orpfawpx zkhdvkw jk zm igju zm urvysbnykk dzadnqzprr mbxnljomiv"
176 "urvysbnykk jk zk igju zm uenvbm jk zm ithtir jk"
177 "zm zk zm zf ofm zm xdcuz dzadnqzprr zm vgsld"
178 "sbptoa jk tugflixoex jk zm zm vgsld zm xh zm"
179 "uhzq jk zk evvivo vgsld vniqnuynvf agmckuiu jk zm zm"
180 "zm nvfasfh zm zm zm abthnzcv uenvbm jk zk dzadnqzprr"
181 "zm azavwm igju qzzqdxq jk xnxhf abthnzcv jk nvfasfh zm"
182 "qbamok fxw vgsld igju cmnnkna xnxhf vniqnuynvf zk xh zm"
183 "nvfasfh zk zm mjpavjuhw dzadnqzprr jk jk duszemmzl xldlpy nvfasfh"
184 "xnxhf sviq nsab npywgdvgz osff vgsld farlehdhq fibokdry wjbkhzsa hhac"
185 "zm azavwm scpgna jk jk bq jk duszemmzl fibokdry ovkyevlgv"
186 "csjqxhgj zm jk jk duszemmzl zk xh zm jk zf"
187 "urvysbnykk dzadnqzprr csjqxhgj mjpavjuhw ubwrfqnbjf nkaotm jk jk zm drir"
188 "nvfasfh xh igju zm wluvgsw jk zm srwwnezqk ewle ovnq"
189 "jk nvfasfh eh ktxdty urvysbnykk vgsld zm jk eh uenvbm"
190 "orpfawpx pahlds jk uhzq hi zm zm zf jk dzadnqzprr"
191 "srwwnezqk csjqxhgj rbwzuf nvfasfh jcpiwj xldlpy nvfasfh jk vgsld wjybxmieki"
194 proc add_empty_records {n} {
196 for {set i 0} {$i < $n} {incr i} {
197 execsql { INSERT INTO t1 VALUES('') }
204 #foreach d $data {set e [concat $e $d]}
205 #puts [lsort -unique $e]
208 set zero_long_doclists {
209 UPDATE t1_segments SET block=zeroblob(length(block)) WHERE length(block)>10000
215 execsql { CREATE VIRTUAL TABLE t1 USING FTS3 }
216 foreach doc $data { execsql { INSERT INTO t1 VALUES($doc) } }
220 execsql { CREATE VIRTUAL TABLE t1 USING FTS4 }
221 foreach doc $data { execsql { INSERT INTO t1 VALUES($doc) } }
224 set dmt_modes {0 1 2}
225 execsql { CREATE VIRTUAL TABLE t1 USING FTS4 }
226 foreach doc $data { execsql { INSERT INTO t1 VALUES($doc) } }
227 add_empty_records 1000
228 execsql $zero_long_doclists
232 execsql { CREATE VIRTUAL TABLE t1 USING FTS4 }
233 foreach doc $data { execsql { INSERT INTO t1 VALUES($doc) } }
234 add_empty_records 1000
235 execsql "INSERT INTO t1(t1) VALUES('optimize')"
236 execsql $zero_long_doclists
240 execsql { CREATE VIRTUAL TABLE t1 USING FTS4(matchinfo=fts3) }
241 foreach doc $data { execsql { INSERT INTO t1 VALUES($doc) } }
242 add_empty_records 1000
243 execsql $zero_long_doclists
247 execsql { DROP TABLE IF EXISTS t1 }
249 set ::testprefix fts3defer-2.$tn
253 SELECT count(*) FROM t1_segments WHERE length(block)>10000
257 SELECT rowid FROM t1 WHERE t1 MATCH 'jk xnxhf'
258 } {13 29 40 47 48 52 63 92}
260 SELECT rowid FROM t1 WHERE t1 MATCH 'jk eh'
263 SELECT rowid FROM t1 WHERE t1 MATCH 'jk ubwrfqnbjf'
266 SELECT rowid FROM t1 WHERE t1 MATCH 'duszemmzl jk'
267 } {3 5 8 10 13 18 20 23 32 37 41 43 55 60 65 67 72 74 76 81 94 96 97}
269 SELECT rowid FROM t1 WHERE t1 MATCH 'ubwrfqnbjf jk'
272 SELECT rowid FROM t1 WHERE t1 MATCH 'jk ubwrfqnbjf jk jk jk jk'
275 SELECT rowid FROM t1 WHERE t1 MATCH 'zm xnxhf'
276 } {12 13 29 30 40 47 48 52 63 92 93}
278 SELECT rowid FROM t1 WHERE t1 MATCH 'zm eh'
281 SELECT rowid FROM t1 WHERE t1 MATCH 'zm ubwrfqnbjf'
283 do_select_test 1.10 {
284 SELECT rowid FROM t1 WHERE t1 MATCH 'z* vgsld'
285 } {10 13 17 31 35 51 58 88 89 90 93 100}
287 if { $fts3_simple_deferred_tokens_only==0 } {
288 do_select_test 1.11 {
291 zdu OR zexh OR zf OR zhbrzadb OR zidhxhbtv OR
292 zk OR zkhdvkw OR zm OR zsmhnf
294 } {10 13 17 31 35 51 58 88 89 90 93 100}
298 SELECT rowid FROM t1 WHERE t1 MATCH '"zm agmckuiu"'
301 SELECT rowid FROM t1 WHERE t1 MATCH '"zm zf"'
304 SELECT rowid FROM t1 WHERE t1 MATCH '"zm aayxpmve"'
307 SELECT rowid FROM t1 WHERE t1 MATCH '"aayxpmve zm"'
310 SELECT rowid FROM t1 WHERE t1 MATCH '"jk azavwm"'
313 SELECT rowid FROM t1 WHERE t1 MATCH '"xh jk jk"'
316 SELECT rowid FROM t1 WHERE t1 MATCH '"zm jk vgsld"'
319 SELECT rowid FROM t1 WHERE t1 MATCH '"zm jk vgsld lkjlkjlkj"'
323 SELECT snippet(t1, '[', ']') FROM t1 WHERE t1 MATCH '"zm agmckuiu"'
325 {zm [zm] [agmckuiu] uhzq nsab jk rrkx duszemmzl hyq jk}
326 {jk [zm] [agmckuiu] urvysbnykk jk jk zm zm jk jk}
327 {[zm] [agmckuiu] zexh fibokdry jk uhzq bu tugflixoex xnxhf sk}
328 {zm zf uenvbm jk azavwm zm [zm] [agmckuiu] zm jk}
332 SELECT snippet(t1, '[', ']') FROM t1 WHERE t1 MATCH 'xnxhf jk'
334 {[xnxhf] [jk] [jk] agmckuiu duszemmzl [jk] zm zm [jk] vgsld}
335 {[jk] [xnxhf] igju [jk] xh [jk] nvfasfh zm js [jk]}
336 {[jk] jcpiwj zm [xnxhf] zm mjpavjuhw mj drir pa pvjrjlas}
337 {gazrt [jk] ephknonq myjp uenvbm wuvajhwqz [jk] zm [xnxhf] nvfasfh}
338 {zm aayxpmve csjqxhgj [xnxhf] xr [jk] aayxpmve [xnxhf] zm zm}
339 {zm agmckuiu zexh fibokdry [jk] uhzq bu tugflixoex [xnxhf] sk}
340 {lwa hi [xnxhf] qdyerbws zk njtc [jk] uhzq zm [jk]}
341 {zm azavwm igju qzzqdxq [jk] [xnxhf] abthnzcv [jk] nvfasfh zm}
345 SELECT offsets(t1) FROM t1 WHERE t1 MATCH '"jk uenvbm"'
347 {0 0 10 2 0 1 13 6} {0 0 26 2 0 1 29 6}
351 SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'duszemmzl jk fibokdry'
353 {0 2 3 8 0 1 36 2 0 0 58 9}
354 {0 0 0 9 0 1 13 2 0 1 16 2 0 2 19 8 0 1 53 2}
355 {0 1 4 2 0 0 20 9 0 1 30 2 0 1 33 2 0 2 48 8}
356 {0 1 17 2 0 1 20 2 0 1 26 2 0 0 29 9 0 2 39 8}
360 SELECT offsets(t1) FROM t1
361 WHERE t1 MATCH 'vgsld (hrlipdm OR (aapmve NEAR duszemmzl))'
362 } {{0 0 0 5 0 1 15 7 0 0 36 5}}
364 # The following block of tests runs normally with FTS3 or FTS4 without the
365 # long doclists zeroed. And with OOM-injection for FTS4 with long doclists
366 # zeroed. Change this by messing with the [set dmt_modes] commands above.
368 foreach DO_MALLOC_TEST $dmt_modes {
372 do_select_test 5.$DO_MALLOC_TEST.1 {
373 SELECT rowid FROM t1 WHERE t1 MATCH '"jk mjpavjuhw"'
376 # Multiple tokens search.
377 do_select_test 5.$DO_MALLOC_TEST.2 {
378 SELECT rowid FROM t1 WHERE t1 MATCH 'duszemmzl zm'
379 } {3 5 8 10 12 13 18 20 23 37 43 55 60 65 67 72 74 81 94 96 97}
381 # snippet() function with phrase.
382 do_select_test 5.$DO_MALLOC_TEST.3 {
383 SELECT snippet(t1, '[', ']') FROM t1 WHERE t1 MATCH '"zm aayxpmve"'
385 {[zm] [aayxpmve] csjqxhgj xnxhf xr jk aayxpmve xnxhf zm zm}
386 {duszemmzl zk jk jk fibokdry jseuhjnzo [zm] [aayxpmve] zk jk}
387 {zf jmfiqhwnjg js igju [zm] [aayxpmve] zm mbxnljomiv csjqxhgj nvfasfh}
390 # snippet() function with multiple tokens.
391 do_select_test 5.$DO_MALLOC_TEST.4 {
392 SELECT snippet(t1, '[', ']') FROM t1 WHERE t1 MATCH 'zm zhbrzadb'
394 {[zm] jk [zm] [zm] [zhbrzadb] uenvbm aayxpmve urvysbnykk duszemmzl jk}
397 # snippet() function with phrase.
398 do_select_test 5.$DO_MALLOC_TEST.5 {
399 SELECT offsets(t1) FROM t1 WHERE t1 MATCH '"zm aayxpmve"'
401 {0 0 0 2 0 1 3 8} {0 0 38 2 0 1 41 8} {0 0 22 2 0 1 25 8}
404 # snippet() function with multiple tokens.
405 do_select_test 5.$DO_MALLOC_TEST.6 {
406 SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'zm zhbrzadb'
408 {0 0 0 2 0 0 6 2 0 0 9 2 0 1 12 8}
416 WHERE t1 MATCH 'vgsld (hrlipdm OR (aayxpmve duszemmzl))'
418 do_select_test 6.2.1 {
419 SELECT rowid FROM t1 WHERE t1 MATCH '"jk xduvfhk"'
421 do_select_test 6.2.2 {
422 SELECT rowid FROM t1 WHERE t1 MATCH '"zm azavwm"'
424 if {$fts3_simple_deferred_tokens_only==0} {
425 do_select_test 6.2.3 {
426 SELECT rowid FROM t1 WHERE t1 MATCH '"jk xduvfhk" OR "zm azavwm"'
431 # These tests will not work with $tn==1, as in this case table t1 is
432 # created using FTS3. The ^ syntax is only available with FTS4 tables.
435 SELECT rowid FROM t1 WHERE t1 MATCH '^zm mjpavjuhw'
438 SELECT rowid FROM t1 WHERE t1 MATCH '^azavwm zm'
443 set testprefix fts3defer
445 do_execsql_test 3.1 {
446 CREATE VIRTUAL TABLE x1 USING fts4(a, b);
447 INSERT INTO x1 VALUES('a b c', 'd e f');
448 INSERT INTO x1 SELECT * FROM x1;
449 INSERT INTO x1 SELECT * FROM x1;
450 INSERT INTO x1 SELECT * FROM x1;
451 INSERT INTO x1 SELECT * FROM x1;
453 do_execsql_test 3.2 "
454 INSERT INTO x1 VALUES(
455 '[string repeat {d } 3000]', '[string repeat {f } 30000]'
457 INSERT INTO x1(x1) VALUES('optimize');
460 do_execsql_test 3.3 {
461 SELECT count(*) FROM x1 WHERE x1 MATCH '"d e f"'
464 # At one point the following was causing a floating-point exception.
466 do_execsql_test 4.1 {
467 CREATE VIRTUAL TABLE x2 USING FTS4(x);
469 INSERT INTO x2 VALUES('m m m m m m m m m m m m m m m m m m m m m m m m m m');
470 INSERT INTO x2 SELECT * FROM x2;
471 INSERT INTO x2 SELECT * FROM x2;
472 INSERT INTO x2 SELECT * FROM x2;
473 INSERT INTO x2 SELECT * FROM x2;
474 INSERT INTO x2 SELECT * FROM x2;
475 INSERT INTO x2 SELECT * FROM x2;
476 INSERT INTO x2 SELECT * FROM x2;
477 INSERT INTO x2 SELECT * FROM x2;
478 INSERT INTO x2 SELECT * FROM x2;
479 INSERT INTO x2 SELECT * FROM x2;
480 INSERT INTO x2 SELECT * FROM x2;
481 INSERT INTO x2 SELECT * FROM x2;
482 INSERT INTO x2 SELECT * FROM x2;
483 INSERT INTO x2 SELECT * FROM x2;
484 INSERT INTO x2 SELECT * FROM x2;
485 INSERT INTO x2 VALUES('a b c d e f g h i j k l m n o p q r s t u v w x y m');
488 do_execsql_test 4.2 {
489 SELECT * FROM x2 WHERE x2 MATCH 'a b c d e f g h i j k l m n o p q r s';
490 } {{a b c d e f g h i j k l m n o p q r s t u v w x y m}}
492 set tokenizers {1 simple}
493 ifcapable icu { lappend tokenizers 2 {icu en_US} }
494 foreach {tn tokenizer} $tokenizers {
495 do_execsql_test 5.$tn.1 "
496 CREATE VIRTUAL TABLE x3 USING FTS4(a, b, TOKENIZE $tokenizer)
498 do_execsql_test 5.$tn.2 {
500 INSERT INTO x3 VALUES('b b b b b b b b b b b', 'b b b b b b b b b b b b b');
501 INSERT INTO x3 SELECT * FROM x3;
502 INSERT INTO x3 SELECT * FROM x3;
503 INSERT INTO x3 SELECT * FROM x3;
504 INSERT INTO x3 SELECT * FROM x3;
505 INSERT INTO x3 SELECT * FROM x3;
506 INSERT INTO x3 SELECT * FROM x3;
507 INSERT INTO x3 SELECT * FROM x3;
508 INSERT INTO x3 SELECT * FROM x3;
509 INSERT INTO x3 SELECT * FROM x3;
510 INSERT INTO x3 SELECT * FROM x3;
511 INSERT INTO x3 SELECT * FROM x3;
512 INSERT INTO x3 SELECT * FROM x3;
513 INSERT INTO x3 SELECT * FROM x3;
514 INSERT INTO x3 SELECT * FROM x3;
515 INSERT INTO x3 SELECT * FROM x3;
516 INSERT INTO x3 SELECT * FROM x3;
517 INSERT INTO x3 VALUES('a b c', NULL);
518 INSERT INTO x3 VALUES('a x c', NULL);
521 SELECT * FROM x3 WHERE x3 MATCH 'a b';
524 do_execsql_test 5.$tn.3 { DROP TABLE x3 }