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 FTS5 module.
14 # Specifically, that the fts5 module is deterministic. At one point, when
15 # segment ids were allocated using sqlite3_randomness(), this was not the
19 source [file join [file dirname [info script]] fts5_common.tcl]
23 proc do_determin_test {tn} {
26 SELECT (SELECT md5sum(id, block) FROM t1_data)==
27 (SELECT md5sum(id, block) FROM t2_data),
28 (SELECT md5sum(id, block) FROM t1_data)==
29 (SELECT md5sum(id, block) FROM t3_data)
34 foreach_detail_mode $::testprefix {
36 CREATE VIRTUAL TABLE t1 USING fts5(a, b, prefix="1 2", detail=%DETAIL%);
37 CREATE VIRTUAL TABLE t2 USING fts5(a, b, prefix="1 2", detail=%DETAIL%);
38 CREATE VIRTUAL TABLE t3 USING fts5(a, b, prefix="1 2", detail=%DETAIL%);
42 foreach t {t1 t2 t3} {
43 execsql [string map [list TBL $t] {
44 INSERT INTO TBL VALUES('a b c', 'd e f');
45 INSERT INTO TBL VALUES('c1 c2 c3', 'c1 c2 c3');
46 INSERT INTO TBL VALUES('xyzxyzxyz', 'xyzxyzxyz');
54 foreach t {t1 t2 t3} {
55 execsql [string map [list TBL $t] {
56 INSERT INTO TBL(TBL) VALUES('optimize');