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 #***********************************************************************
14 source [file join [file dirname [info script]] fts5_common.tcl]
15 set testprefix fts5optimize
17 # If SQLITE_ENABLE_FTS5 is defined, omit this file.
24 set vocab {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 z}
25 set nVocab [llength $vocab]
27 for {set i 0} {$i < $nWord} {incr i} {
28 lappend ret [lindex $vocab [expr {int(rand() * $nVocab)}]]
43 do_execsql_test 1.$tn.1 {
44 CREATE VIRTUAL TABLE t1 USING fts5(x, y);
47 for {set i 0} {$i < $nStep} {incr i} {
48 execsql { INSERT INTO t1 VALUES( rnddoc(5), rnddoc(5) ) }
52 do_execsql_test 1.$tn.3 {
53 INSERT INTO t1(t1) VALUES('integrity-check');
56 do_execsql_test 1.$tn.4 {
57 INSERT INTO t1(t1) VALUES('optimize');
60 do_execsql_test 1.$tn.5 {
61 INSERT INTO t1(t1) VALUES('integrity-check');