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 #*************************************************************************
11 # This file implements regression tests for SQLite library. The
12 # focus of this script is testing the FTS4 module.
16 set testdir [file dirname $argv0]
17 source $testdir/tester.tcl
18 set testprefix fts4growth2
20 # If SQLITE_ENABLE_FTS3 is defined, omit this file.
26 source $testdir/genesis.tcl
28 do_execsql_test 1.0 { CREATE TABLE t1(docid, words); }
32 puts [ db eval {SELECT level, count(*) FROM x1_segdir GROUP BY level} ]
38 WHERE docid IN (SELECT docid FROM t1 WHERE (rowid-1)%4==$val+0);
41 INSERT INTO x1(docid, content)
42 SELECT docid, words FROM t1 WHERE (rowid%4)==$val+0;
47 CREATE VIRTUAL TABLE x1 USING fts4;
48 INSERT INTO x1(x1) VALUES('automerge=2');
52 for {set i 0} {$i < 40} {incr i} {
53 tt 0 ; tt 1 ; tt 2 ; tt 3
56 SELECT max(level) FROM x1_segdir;
57 SELECT count(*) FROM x1_segdir WHERE level=2;
62 for {set i 0} {$i < 40} {incr i} {
63 tt 0 ; tt 1 ; tt 2 ; tt 3
66 SELECT max(level) FROM x1_segdir;
67 SELECT count(*) FROM x1_segdir WHERE level=2;
71 #-------------------------------------------------------------------------
74 DELETE FROM t1 WHERE rowid>16;
75 DROP TABLE IF EXISTS x1;
76 CREATE VIRTUAL TABLE x1 USING fts4;
80 proc second {L} {lindex $L 1}
82 for {set tn 0} {$tn < 40} {incr tn} {
84 for {set i 0} {$i < 100} {incr i} {
85 tt 0 ; tt 1 ; tt 2 ; tt 3
87 execsql { SELECT max(level) FROM x1_segdir }