blob: 8e2119de2b1c63415364ccc7ee0b94fa6f91c12b [file] [log] [blame]
danba4f01e2013-05-29 14:22:19 +00001# 2013 May 29
2#
3# The author disclaims copyright to this source code. In place of
4# a legal notice, here is a blessing:
5#
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.
9#
10#*************************************************************************
11# This file implements regression tests for SQLite library.
12#
13
14set testdir [file dirname $argv0]
15source $testdir/tester.tcl
16source $testdir/fts3_common.tcl
17set ::testprefix fts4merge4
18
19ifcapable !fts3 {
20 finish_test
21 return
22}
23
24set ::enable_shared_cache [sqlite3_enable_shared_cache 1]
25
26do_execsql_test 1.1 { CREATE VIRTUAL TABLE t1 USING fts4 }
27
28do_test 1.2 {
29 for {set i 0} {$i < 2000} {incr i} {
30 execsql {INSERT INTO t1 VALUES('a b c d e f g h i j k l');}
31 }
32} {}
33
34do_test 1.3 {
35 execsql BEGIN
36 for {set i 0} {$i < 2000} {incr i} {
37 execsql {INSERT INTO t1 VALUES('a b c d e f g h i j k l');}
38 }
39 execsql {
40 INSERT INTO t1(t1) VALUES('merge=8,50');
41 COMMIT
42 }
43} {}
44
45reset_db
46do_execsql_test 2.0 { CREATE VIRTUAL TABLE t1 USING fts4 }
47do_test 2.1 {
48 for {set i 0} {$i < 2000} {incr i} {
49 execsql {INSERT INTO t1 VALUES('a b c d e f g h i j k l');}
50 }
51} {}
52do_execsql_test 2.2 { SELECT count(*) FROM t1_segdir; } 35
53do_execsql_test 2.3 { INSERT INTO t1(t1) VALUES('optimize') } {}
54do_execsql_test 2.4 { SELECT count(*) FROM t1_segdir; } 1
55
56
57sqlite3_enable_shared_cache $::enable_shared_cache
58finish_test