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 # The tests in this file focus on "unindexed" columns.
15 source [file join [file dirname [info script]] fts5_common.tcl]
16 set testprefix fts5unindexed
18 # If SQLITE_ENABLE_FTS5 is defined, omit this file.
26 CREATE VIRTUAL TABLE t1 USING fts5(a, b UNINDEXED);
27 INSERT INTO t1 VALUES('a b c', 'd e f');
28 INSERT INTO t1 VALUES('g h i', 'j k l');
31 do_execsql_test 1.2 { SELECT rowid FROM t1 WHERE t1 MATCH 'b' } {1}
32 do_execsql_test 1.3 { SELECT rowid FROM t1 WHERE t1 MATCH 'e' } {}
34 do_execsql_test 1.4 { INSERT INTO t1(t1) VALUES('integrity-check') } {}
35 do_execsql_test 1.5 { INSERT INTO t1(t1) VALUES('rebuild') } {}
36 do_execsql_test 1.6 { INSERT INTO t1(t1) VALUES('integrity-check') } {}
38 do_execsql_test 1.7 { SELECT rowid FROM t1 WHERE t1 MATCH 'b' } {1}
39 do_execsql_test 1.8 { SELECT rowid FROM t1 WHERE t1 MATCH 'e' } {}
41 do_execsql_test 1.9 { DELETE FROM t1 WHERE t1 MATCH 'b' } {}
43 do_execsql_test 1.10 { INSERT INTO t1(t1) VALUES('integrity-check') } {}
44 do_execsql_test 1.11 { INSERT INTO t1(t1) VALUES('rebuild') } {}
45 do_execsql_test 1.12 { INSERT INTO t1(t1) VALUES('integrity-check') } {}
47 do_execsql_test 1.13 { SELECT rowid FROM t1 WHERE t1 MATCH 'i' } {2}
48 do_execsql_test 1.14 { SELECT rowid FROM t1 WHERE t1 MATCH 'l' } {}
51 CREATE VIRTUAL TABLE t2 USING fts5(a UNINDEXED, b UNINDEXED);
52 INSERT INTO t1 VALUES('a b c', 'd e f');
53 INSERT INTO t1 VALUES('g h i', 'j k l');
54 SELECT rowid FROM t2_data;
57 INSERT INTO t2(t2) VALUES('rebuild');
58 INSERT INTO t2(t2) VALUES('integrity-check');
59 SELECT rowid FROM t2_data;
63 CREATE TABLE x4(i INTEGER PRIMARY KEY, a, b, c);
64 CREATE VIRTUAL TABLE t4 USING fts5(a, b UNINDEXED, c, content=x4);
65 INSERT INTO x4 VALUES(10, 'a b c', 'd e f', 'g h i');
66 INSERT INTO x4 VALUES(20, 'j k l', 'm n o', 'p q r');
67 INSERT INTO t4(t4) VALUES('rebuild');
68 INSERT INTO t4(t4) VALUES('integrity-check');
72 INSERT INTO t4(t4, rowid, a, b, c) VALUES('delete', 20, 'j k l', '', 'p q r');
73 DELETE FROM x4 WHERE rowid=20;
74 INSERT INTO t4(t4) VALUES('integrity-check');