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
62 sqlite3_db_config db DEFENSIVE 0
64 SELECT count(*) FROM t1_segments WHERE length(block)>10000;
66 SET block = zeroblob(length(block))
67 WHERE length(block)>10000;
70 do_select_tests 1.4 $tests
72 # Drop the table. It is corrupt now anyhow, so not useful for subsequent tests.
74 do_execsql_test 1.5 { DROP TABLE t1 }
76 #--------------------------------------------------------------------------
77 # These tests - fts3defer-2.* - are more rigorous. They test that for a
78 # variety of queries, FTS3 and FTS4 return the same results. And that
79 # zeroing the very large doclists that FTS4 does not load does not change
82 # They use the following pseudo-randomly generated document data. The
83 # tokens "zm" and "jk" are especially common in this dataset. Additionally,
84 # two documents are added to the pseudo-random data before it is loaded
85 # into FTS4 containing 100,000 instances of the "zm" and "jk" tokens. This
86 # makes the doclists for those tokens so large that FTS4 avoids loading them
87 # into memory if possible.
90 lappend data [string repeat "zm " 100000]
91 lappend data [string repeat "jk " 100000]
93 "zm zm agmckuiu uhzq nsab jk rrkx duszemmzl hyq jk"
94 "jk uhzq zm zm rgpzmlnmd zm zk jk jk zm"
95 "duszemmzl zm jk xldlpy zm jk sbptoa xh jk xldlpy"
96 "zm xh zm xqf azavwm jk jk trqd rgpzmlnmd jk"
97 "zm vwq urvysbnykk ubwrfqnbjf zk lsz jk doiwavhwwo jk jk"
98 "jk xduvfhk orpfawpx zkhdvkw jk mjpavjuhw zm jk duszemmzl zm"
99 "jk igju jk jk zm hmjf xh zm gwdfhwurx zk"
100 "vgsld jk jk zm hrlipdm jn zm zsmhnf vgsld duszemmzl"
101 "gtuiexzsu aayxpmve zm zm zm drir scpgna xh azavwm uhzq"
102 "farlehdhq hkfoudzftq igju duszemmzl xnxhf ewle zm hrlipdm urvysbnykk kn"
103 "xnxhf jk jk agmckuiu duszemmzl jk zm zm jk vgsld"
104 "zm zm zm jk jk urvysbnykk ogttbykvt zm zm jk"
105 "iasrqgqv zm azavwm zidhxhbtv jk jk mjpavjuhw zm zm ajmvcydy"
106 "rgpzmlnmd tmt mjpavjuhw xh igju jk azavwm fibokdry vgsld ofm"
107 "zm jk vgsld jk xh jk csjqxhgj drir jk pmrb"
108 "xh jk jk zm rrkx duszemmzl mjpavjuhw xldlpy igju zm"
109 "jk hkfoudzftq zf rrkx wdmy jupk jk zm urvysbnykk npywgdvgz"
110 "zm jk zm zm zhbrzadb uenvbm aayxpmve urvysbnykk duszemmzl jk"
111 "uenvbm jk zm fxw xh bdilwmjw mjpavjuhw uv jk zm"
112 "nk jk bnhc pahlds jk igju dzadnqzprr jk jk jk"
113 "uhzq uv zm duszemmzl tlqix jk jk xh jk zm"
114 "jk zm agmckuiu urvysbnykk jk jk zm zm jk jk"
115 "azavwm mjpavjuhw lsgshn trqd xldlpy ogyavjvv agmckuiu ryvwwhlbc jk jk"
116 "tmt jk zk zm azavwm ofm acpgim bvgimjik iasrqgqv wuvajhwqz"
117 "igju ogyavjvv xrbdak rrkx fibokdry zf ujfhmrllq jk zm hxgwvib"
118 "zm pahlds jk uenvbm aayxpmve iaf hmjf xph vnlyvtkgx zm"
119 "jk xnxhf igju jk xh jk nvfasfh zm js jk"
120 "zm zm rwaj igju xr rrkx xnxhf nvfasfh skxbsqzvmt xatbxeqq"
121 "vgsld zm ujfhmrllq uhzq ogyavjvv nsab azavwm zm vgsld jmfiqhwnjg"
122 "ymjoym duszemmzl urvysbnykk azavwm jk jmfiqhwnjg bu qcdziqomqk vnlyvtkgx"
123 "zm nbilqcnz dzadnqzprr xh bkfgzsxn urvysbnykk xrujfzxqf zm zf agmckuiu"
124 "jk urvysbnykk nvfasfh zf xh zm zm qcdziqomqk qvxtclg wdmy"
125 "fibokdry jk urvysbnykk jk xr osff zm cvnnsl zm vgsld"
126 "jk mjpavjuhw hkfoudzftq jk zm xh xqf urvysbnykk jk iasrqgqv"
127 "jk csjqxhgj duszemmzl iasrqgqv aayxpmve zm brsuoqww jk qpmhtvl wluvgsw"
128 "jk mj azavwm jk zm jn dzadnqzprr zm jk uhzq"
129 "zk xqf jupk fxw nbilqcnz zm jk jcpiwj tznlvbfcv nvfasfh"
130 "jk jcpiwj zm xnxhf zm mjpavjuhw mj drir pa pvjrjlas"
131 "duszemmzl dzadnqzprr jk swc duszemmzl tmt jk jk pahlds jk"
132 "zk zm jk zm zm eczkjblu zm hi pmrb jk"
133 "azavwm zm iz agmckuiu jk sntk jk duszemmzl duszemmzl zm"
134 "jk zm jk eczkjblu urvysbnykk sk gnl jk ttvgf hmjf"
135 "jk bnhc jjrxpjkb mjpavjuhw fibokdry igju jk zm zm xh"
136 "wxe ogttbykvt uhzq xr iaf zf urvysbnykk aayxpmve oacaxgjoo mjpavjuhw"
137 "gazrt jk ephknonq myjp uenvbm wuvajhwqz jk zm xnxhf nvfasfh"
138 "zm aayxpmve csjqxhgj xnxhf xr jk aayxpmve xnxhf zm zm"
139 "sokcyf zm ogyavjvv jk zm fibokdry zm jk igju igju"
140 "vgsld bvgimjik xuprtlyle jk akmikrqyt jk aayxpmve hkfoudzftq ddjj ithtir"
141 "zm uhzq ovkyevlgv zk uenvbm csjqxhgj jk vgsld pgybs jk"
142 "zm agmckuiu zexh fibokdry jk uhzq bu tugflixoex xnxhf sk"
143 "zm zf uenvbm jk azavwm zm zm agmckuiu zm jk"
144 "rrkx jk zf jt zm oacaxgjoo fibokdry wdmy igju csjqxhgj"
145 "hi igju zm jk zidhxhbtv dzadnqzprr jk jk trqd duszemmzl"
146 "zm zm mjpavjuhw xrbdak qrvbjruc jk qzzqdxq guwq cvnnsl zm"
147 "ithtir jk jk qcdziqomqk zm farlehdhq zm zm xrbdak jk"
148 "ixfipk csjqxhgj azavwm sokcyf ttvgf vgsld jk sk xh zk"
149 "nvfasfh azavwm zm zm zm fxw nvfasfh zk gnl trqd"
150 "zm fibokdry csjqxhgj ofm dzadnqzprr jk akmikrqyt orpfawpx duszemmzl vwq"
151 "csjqxhgj jk jk vgsld urvysbnykk jk nxum jk jk nxum"
152 "zm hkfoudzftq jk ryvwwhlbc mjpavjuhw ephknonq jk zm ogyavjvv zm"
153 "lwa hi xnxhf qdyerbws zk njtc jk uhzq zm jk"
154 "trqd zm dzadnqzprr zm urvysbnykk jk lsz jk mjpavjuhw cmnnkna"
155 "duszemmzl zk jk jk fibokdry jseuhjnzo zm aayxpmve zk jk"
156 "fibokdry jk sviq qvxtclg wdmy jk doiwavhwwo zexh jk zm"
157 "jupk zm xh jk mjpavjuhw zm jk nsab npywgdvgz duszemmzl"
158 "zm igju zm zm nvfasfh eh hkfoudzftq fibokdry fxw xkblf"
159 "jk zm jk jk zm xh zk abthnzcv zf csjqxhgj"
160 "zm zm jk nkaotm urvysbnykk sbptoa bq jk ktxdty ubwrfqnbjf"
161 "nvfasfh aayxpmve xdcuz zm tugflixoex jcpiwj zm mjpavjuhw fibokdry doiwavhwwo"
162 "iaf jk mjpavjuhw zm duszemmzl jk jk uhzq pahlds fibokdry"
163 "ddjj zk azavwm jk swc zm gjtexkv jk xh jk"
164 "igju jk csjqxhgj zm jk dzadnqzprr duszemmzl ulvcbv jk jk"
165 "jk fibokdry zm csjqxhgj jn zm zm zm zf uhzq"
166 "duszemmzl jk xkblf zk hrlipdm aayxpmve uenvbm uhzq jk zf"
167 "dzadnqzprr jk zm zdu nvfasfh zm jk urvysbnykk hmjf jk"
168 "jk aayxpmve aserrdxm acpgim fibokdry jk drir wxe brsuoqww rrkx"
169 "uhzq csjqxhgj nvfasfh jk rrkx qbamok trqd uenvbm sntk zm"
170 "ps azavwm zkhdvkw jk zm jk jk zm csjqxhgj xedlrcfo"
171 "jk jk ogyavjvv jk zm farlehdhq duszemmzl jk agitgxamxe jk"
172 "qzzqdxq rwaj jk jk zm xqf jk uenvbm jk zk"
173 "zm hxgwvib akmikrqyt zf agmckuiu uenvbm bq npywgdvgz azavwm jk"
174 "zf jmfiqhwnjg js igju zm aayxpmve zm mbxnljomiv csjqxhgj nvfasfh"
175 "zm jk jk gazrt jk jk lkc jk nvfasfh jk"
176 "xldlpy orpfawpx zkhdvkw jk zm igju zm urvysbnykk dzadnqzprr mbxnljomiv"
177 "urvysbnykk jk zk igju zm uenvbm jk zm ithtir jk"
178 "zm zk zm zf ofm zm xdcuz dzadnqzprr zm vgsld"
179 "sbptoa jk tugflixoex jk zm zm vgsld zm xh zm"
180 "uhzq jk zk evvivo vgsld vniqnuynvf agmckuiu jk zm zm"
181 "zm nvfasfh zm zm zm abthnzcv uenvbm jk zk dzadnqzprr"
182 "zm azavwm igju qzzqdxq jk xnxhf abthnzcv jk nvfasfh zm"
183 "qbamok fxw vgsld igju cmnnkna xnxhf vniqnuynvf zk xh zm"
184 "nvfasfh zk zm mjpavjuhw dzadnqzprr jk jk duszemmzl xldlpy nvfasfh"
185 "xnxhf sviq nsab npywgdvgz osff vgsld farlehdhq fibokdry wjbkhzsa hhac"
186 "zm azavwm scpgna jk jk bq jk duszemmzl fibokdry ovkyevlgv"
187 "csjqxhgj zm jk jk duszemmzl zk xh zm jk zf"
188 "urvysbnykk dzadnqzprr csjqxhgj mjpavjuhw ubwrfqnbjf nkaotm jk jk zm drir"
189 "nvfasfh xh igju zm wluvgsw jk zm srwwnezqk ewle ovnq"
190 "jk nvfasfh eh ktxdty urvysbnykk vgsld zm jk eh uenvbm"
191 "orpfawpx pahlds jk uhzq hi zm zm zf jk dzadnqzprr"
192 "srwwnezqk csjqxhgj rbwzuf nvfasfh jcpiwj xldlpy nvfasfh jk vgsld wjybxmieki"
195 proc add_empty_records {n} {
197 for {set i 0} {$i < $n} {incr i} {
198 execsql { INSERT INTO t1 VALUES('') }
205 #foreach d $data {set e [concat $e $d]}
206 #puts [lsort -unique $e]
209 set zero_long_doclists {
210 UPDATE t1_segments SET block=zeroblob(length(block)) WHERE length(block)>10000
216 execsql { CREATE VIRTUAL TABLE t1 USING FTS3 }
217 foreach doc $data { execsql { INSERT INTO t1 VALUES($doc) } }
221 execsql { CREATE VIRTUAL TABLE t1 USING FTS4 }
222 foreach doc $data { execsql { INSERT INTO t1 VALUES($doc) } }
225 set dmt_modes {0 1 2}
226 execsql { CREATE VIRTUAL TABLE t1 USING FTS4 }
227 foreach doc $data { execsql { INSERT INTO t1 VALUES($doc) } }
228 add_empty_records 1000
229 sqlite3_db_config db DEFENSIVE 0
230 execsql $zero_long_doclists
234 execsql { CREATE VIRTUAL TABLE t1 USING FTS4 }
235 foreach doc $data { execsql { INSERT INTO t1 VALUES($doc) } }
236 add_empty_records 1000
237 execsql "INSERT INTO t1(t1) VALUES('optimize')"
238 sqlite3_db_config db DEFENSIVE 0
239 execsql $zero_long_doclists
243 execsql { CREATE VIRTUAL TABLE t1 USING FTS4(matchinfo=fts3) }
244 foreach doc $data { execsql { INSERT INTO t1 VALUES($doc) } }
245 add_empty_records 1000
246 sqlite3_db_config db DEFENSIVE 0
247 execsql $zero_long_doclists
251 execsql { DROP TABLE IF EXISTS t1 }
253 set ::testprefix fts3defer-2.$tn
257 SELECT count(*) FROM t1_segments WHERE length(block)>10000
261 SELECT rowid FROM t1 WHERE t1 MATCH 'jk xnxhf'
262 } {13 29 40 47 48 52 63 92}
264 SELECT rowid FROM t1 WHERE t1 MATCH 'jk eh'
267 SELECT rowid FROM t1 WHERE t1 MATCH 'jk ubwrfqnbjf'
270 SELECT rowid FROM t1 WHERE t1 MATCH 'duszemmzl jk'
271 } {3 5 8 10 13 18 20 23 32 37 41 43 55 60 65 67 72 74 76 81 94 96 97}
273 SELECT rowid FROM t1 WHERE t1 MATCH 'ubwrfqnbjf jk'
276 SELECT rowid FROM t1 WHERE t1 MATCH 'jk ubwrfqnbjf jk jk jk jk'
279 SELECT rowid FROM t1 WHERE t1 MATCH 'zm xnxhf'
280 } {12 13 29 30 40 47 48 52 63 92 93}
282 SELECT rowid FROM t1 WHERE t1 MATCH 'zm eh'
285 SELECT rowid FROM t1 WHERE t1 MATCH 'zm ubwrfqnbjf'
287 do_select_test 1.10 {
288 SELECT rowid FROM t1 WHERE t1 MATCH 'z* vgsld'
289 } {10 13 17 31 35 51 58 88 89 90 93 100}
291 if { $fts3_simple_deferred_tokens_only==0 } {
292 do_select_test 1.11 {
295 zdu OR zexh OR zf OR zhbrzadb OR zidhxhbtv OR
296 zk OR zkhdvkw OR zm OR zsmhnf
298 } {10 13 17 31 35 51 58 88 89 90 93 100}
302 SELECT rowid FROM t1 WHERE t1 MATCH '"zm agmckuiu"'
305 SELECT rowid FROM t1 WHERE t1 MATCH '"zm zf"'
308 SELECT rowid FROM t1 WHERE t1 MATCH '"zm aayxpmve"'
311 SELECT rowid FROM t1 WHERE t1 MATCH '"aayxpmve zm"'
314 SELECT rowid FROM t1 WHERE t1 MATCH '"jk azavwm"'
317 SELECT rowid FROM t1 WHERE t1 MATCH '"xh jk jk"'
320 SELECT rowid FROM t1 WHERE t1 MATCH '"zm jk vgsld"'
323 SELECT rowid FROM t1 WHERE t1 MATCH '"zm jk vgsld lkjlkjlkj"'
327 SELECT snippet(t1, '[', ']') FROM t1 WHERE t1 MATCH '"zm agmckuiu"'
329 {zm [zm] [agmckuiu] uhzq nsab jk rrkx duszemmzl hyq jk}
330 {jk [zm] [agmckuiu] urvysbnykk jk jk zm zm jk jk}
331 {[zm] [agmckuiu] zexh fibokdry jk uhzq bu tugflixoex xnxhf sk}
332 {zm zf uenvbm jk azavwm zm [zm] [agmckuiu] zm jk}
336 SELECT snippet(t1, '[', ']') FROM t1 WHERE t1 MATCH 'xnxhf jk'
338 {[xnxhf] [jk] [jk] agmckuiu duszemmzl [jk] zm zm [jk] vgsld}
339 {[jk] [xnxhf] igju [jk] xh [jk] nvfasfh zm js [jk]}
340 {[jk] jcpiwj zm [xnxhf] zm mjpavjuhw mj drir pa pvjrjlas}
341 {gazrt [jk] ephknonq myjp uenvbm wuvajhwqz [jk] zm [xnxhf] nvfasfh}
342 {zm aayxpmve csjqxhgj [xnxhf] xr [jk] aayxpmve [xnxhf] zm zm}
343 {zm agmckuiu zexh fibokdry [jk] uhzq bu tugflixoex [xnxhf] sk}
344 {lwa hi [xnxhf] qdyerbws zk njtc [jk] uhzq zm [jk]}
345 {zm azavwm igju qzzqdxq [jk] [xnxhf] abthnzcv [jk] nvfasfh zm}
349 SELECT offsets(t1) FROM t1 WHERE t1 MATCH '"jk uenvbm"'
351 {0 0 10 2 0 1 13 6} {0 0 26 2 0 1 29 6}
355 SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'duszemmzl jk fibokdry'
357 {0 2 3 8 0 1 36 2 0 0 58 9}
358 {0 0 0 9 0 1 13 2 0 1 16 2 0 2 19 8 0 1 53 2}
359 {0 1 4 2 0 0 20 9 0 1 30 2 0 1 33 2 0 2 48 8}
360 {0 1 17 2 0 1 20 2 0 1 26 2 0 0 29 9 0 2 39 8}
364 SELECT offsets(t1) FROM t1
365 WHERE t1 MATCH 'vgsld (hrlipdm OR (aapmve NEAR duszemmzl))'
366 } {{0 0 0 5 0 1 15 7 0 0 36 5}}
368 # The following block of tests runs normally with FTS3 or FTS4 without the
369 # long doclists zeroed. And with OOM-injection for FTS4 with long doclists
370 # zeroed. Change this by messing with the [set dmt_modes] commands above.
372 foreach DO_MALLOC_TEST $dmt_modes {
376 do_select_test 5.$DO_MALLOC_TEST.1 {
377 SELECT rowid FROM t1 WHERE t1 MATCH '"jk mjpavjuhw"'
380 # Multiple tokens search.
381 do_select_test 5.$DO_MALLOC_TEST.2 {
382 SELECT rowid FROM t1 WHERE t1 MATCH 'duszemmzl zm'
383 } {3 5 8 10 12 13 18 20 23 37 43 55 60 65 67 72 74 81 94 96 97}
385 # snippet() function with phrase.
386 do_select_test 5.$DO_MALLOC_TEST.3 {
387 SELECT snippet(t1, '[', ']') FROM t1 WHERE t1 MATCH '"zm aayxpmve"'
389 {[zm] [aayxpmve] csjqxhgj xnxhf xr jk aayxpmve xnxhf zm zm}
390 {duszemmzl zk jk jk fibokdry jseuhjnzo [zm] [aayxpmve] zk jk}
391 {zf jmfiqhwnjg js igju [zm] [aayxpmve] zm mbxnljomiv csjqxhgj nvfasfh}
394 # snippet() function with multiple tokens.
395 do_select_test 5.$DO_MALLOC_TEST.4 {
396 SELECT snippet(t1, '[', ']') FROM t1 WHERE t1 MATCH 'zm zhbrzadb'
398 {[zm] jk [zm] [zm] [zhbrzadb] uenvbm aayxpmve urvysbnykk duszemmzl jk}
401 # snippet() function with phrase.
402 do_select_test 5.$DO_MALLOC_TEST.5 {
403 SELECT offsets(t1) FROM t1 WHERE t1 MATCH '"zm aayxpmve"'
405 {0 0 0 2 0 1 3 8} {0 0 38 2 0 1 41 8} {0 0 22 2 0 1 25 8}
408 # snippet() function with multiple tokens.
409 do_select_test 5.$DO_MALLOC_TEST.6 {
410 SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'zm zhbrzadb'
412 {0 0 0 2 0 0 6 2 0 0 9 2 0 1 12 8}
420 WHERE t1 MATCH 'vgsld (hrlipdm OR (aayxpmve duszemmzl))'
422 do_select_test 6.2.1 {
423 SELECT rowid FROM t1 WHERE t1 MATCH '"jk xduvfhk"'
425 do_select_test 6.2.2 {
426 SELECT rowid FROM t1 WHERE t1 MATCH '"zm azavwm"'
428 if {$fts3_simple_deferred_tokens_only==0} {
429 do_select_test 6.2.3 {
430 SELECT rowid FROM t1 WHERE t1 MATCH '"jk xduvfhk" OR "zm azavwm"'
435 # These tests will not work with $tn==1, as in this case table t1 is
436 # created using FTS3. The ^ syntax is only available with FTS4 tables.
439 SELECT rowid FROM t1 WHERE t1 MATCH '^zm mjpavjuhw'
442 SELECT rowid FROM t1 WHERE t1 MATCH '^azavwm zm'
447 set testprefix fts3defer
449 do_execsql_test 3.1 {
450 CREATE VIRTUAL TABLE x1 USING fts4(a, b);
451 INSERT INTO x1 VALUES('a b c', 'd e f');
452 INSERT INTO x1 SELECT * FROM x1;
453 INSERT INTO x1 SELECT * FROM x1;
454 INSERT INTO x1 SELECT * FROM x1;
455 INSERT INTO x1 SELECT * FROM x1;
457 do_execsql_test 3.2 "
458 INSERT INTO x1 VALUES(
459 '[string repeat {d } 3000]', '[string repeat {f } 30000]'
461 INSERT INTO x1(x1) VALUES('optimize');
464 do_execsql_test 3.3 {
465 SELECT count(*) FROM x1 WHERE x1 MATCH '"d e f"'
468 # At one point the following was causing a floating-point exception.
470 do_execsql_test 4.1 {
471 CREATE VIRTUAL TABLE x2 USING FTS4(x);
473 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');
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 SELECT * FROM x2;
486 INSERT INTO x2 SELECT * FROM x2;
487 INSERT INTO x2 SELECT * FROM x2;
488 INSERT INTO x2 SELECT * FROM x2;
489 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');
492 do_execsql_test 4.2 {
493 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';
494 } {{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}}
496 set tokenizers {1 simple}
497 ifcapable icu { lappend tokenizers 2 {icu en_US} }
498 foreach {tn tokenizer} $tokenizers {
499 do_execsql_test 5.$tn.1 "
500 CREATE VIRTUAL TABLE x3 USING FTS4(a, b, TOKENIZE $tokenizer)
502 do_execsql_test 5.$tn.2 {
504 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');
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 SELECT * FROM x3;
518 INSERT INTO x3 SELECT * FROM x3;
519 INSERT INTO x3 SELECT * FROM x3;
520 INSERT INTO x3 SELECT * FROM x3;
521 INSERT INTO x3 VALUES('a b c', NULL);
522 INSERT INTO x3 VALUES('a x c', NULL);
525 SELECT * FROM x3 WHERE x3 MATCH 'a b';
528 do_execsql_test 5.$tn.3 { DROP TABLE x3 }