Fix a problem causing the recovery extension to use excessive memory and CPU time...
[sqlite.git] / test / fts3f.test
blobd9a57cbc30ab455fef9d0c68e8914b805b89f97d
1 # 2006 September 9
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 FTS3 module.
14 # $Id: fts3aa.test,v 1.1 2007/08/20 17:38:42 shess Exp $
17 set testdir [file dirname $argv0]
18 source $testdir/tester.tcl
19 set testprefix fts3f
21 # If SQLITE_ENABLE_FTS3 is defined, omit this file.
22 ifcapable !fts3 {
23   finish_test
24   return
27 do_execsql_test 1.0 {
28   CREATE VIRTUAL TABLE ft USING fts3(x);
29   BEGIN;
30     INSERT INTO ft VALUES('a one'), ('b one'), ('c one');
33 do_test 1.1 {
34   set ret [list]
35   db eval { SELECT docid FROM ft WHERE ft MATCH 'one' } {
36     if { $docid==2 } {
37       db eval COMMIT
38     }
39     lappend ret $docid
40   }
41   set ret
42 } {1 2 3}
44 do_execsql_test 1.2 {
45   BEGIN;
46     INSERT INTO ft VALUES('a one'), ('b one'), ('c one');
49 do_execsql_test 1.3 {
50   SELECT docid, optimize(ft) FROM ft WHERE ft MATCH 'one'
51 } {
52   1 {Index optimized} 2 {Index already optimal} 3 {Index already optimal}
53   4 {Index already optimal}
54   5 {Index already optimal} 6 {Index already optimal}
57 finish_test