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 # Test that focus on incremental merges of segments.
15 source [file join [file dirname [info script]] fts5_common.tcl]
16 set testprefix fts5merge2
19 proc dump_structure {} {
20 db eval {SELECT fts5_decode(id, block) AS t FROM t1_data WHERE id=10} {
21 foreach lvl [lrange $t 1 end] {
22 set seg [string repeat . [expr [llength $lvl]-2]]
23 puts "[lrange $lvl 0 1] $seg"
28 foreach_detail_mode $testprefix {
31 CREATE VIRTUAL TABLE t1 USING fts5(x, detail=%DETAIL%);
32 INSERT INTO t1(t1, rank) VALUES('pgsz', 32);
33 INSERT INTO t1(t1, rank) VALUES('crisismerge', 2);
34 INSERT INTO t1 VALUES('1 2 3 4');
38 db func rnddoc fts5_rnddoc
40 for {set i 0} {$i < 100} {incr i} {
43 DELETE FROM t1 WHERE rowid = 1;
44 INSERT INTO t1(rowid, x) VALUES(1, '1 2 3 4');
45 INSERT INTO t1 VALUES(rnddoc(10));
52 INSERT INTO t1(t1) VALUES('integrity-check');