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 #*************************************************************************
13 source [file join [file dirname [info script]] fts5_common.tcl]
14 ifcapable !fts5 { finish_test ; return }
15 set ::testprefix fts5secure2
18 CREATE VIRTUAL TABLE ft USING fts5(col);
19 INSERT INTO ft VALUES('data for the table');
20 INSERT INTO ft VALUES('more of the same');
21 INSERT INTO ft VALUES('and extra data');
25 SELECT * FROM ft_config
29 INSERT INTO ft(ft, rank) VALUES('secure-delete', 1);
30 SELECT * FROM ft_config;
31 } {secure-delete 1 version 4}
34 INSERT INTO ft(ft, rank) VALUES('secure-delete', 1);
35 SELECT * FROM ft_config;
36 } {secure-delete 1 version 4}
39 DELETE FROM ft WHERE rowid=2;
40 SELECT * FROM ft_config;
41 } {secure-delete 1 version 5}
44 SELECT rowid, col FROM ft('data');
45 } {1 {data for the table} 3 {and extra data}}
51 SELECT rowid, col FROM ft('data');
52 } {1 {data for the table} 3 {and extra data}}
54 #------------------------------------------------------------------------
58 CREATE VIRTUAL TABLE ft USING fts5(col);
59 INSERT INTO ft VALUES('one zero one one zero');
60 INSERT INTO ft(ft, rank) VALUES('secure-delete', 1);
64 SELECT count(*) FROM ft_data WHERE block=X'00000004';
68 UPDATE ft SET col = 'zero one zero zero one' WHERE rowid=1;
72 SELECT count(*) FROM ft_data WHERE block=X'00000004';
76 INSERT INTO ft VALUES('one zero zero one');
77 DELETE FROM ft WHERE rowid=1;
81 SELECT count(*) FROM ft_data WHERE block=X'00000004';