dan | ba4f01e | 2013-05-29 14:22:19 +0000 | [diff] [blame] | 1 | # 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 | |
| 14 | set testdir [file dirname $argv0] |
| 15 | source $testdir/tester.tcl |
| 16 | source $testdir/fts3_common.tcl |
| 17 | set ::testprefix fts4merge4 |
| 18 | |
| 19 | ifcapable !fts3 { |
| 20 | finish_test |
| 21 | return |
| 22 | } |
| 23 | |
| 24 | set ::enable_shared_cache [sqlite3_enable_shared_cache 1] |
| 25 | |
| 26 | do_execsql_test 1.1 { CREATE VIRTUAL TABLE t1 USING fts4 } |
| 27 | |
| 28 | do_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 | |
| 34 | do_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 | |
| 45 | reset_db |
| 46 | do_execsql_test 2.0 { CREATE VIRTUAL TABLE t1 USING fts4 } |
| 47 | do_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 | } {} |
| 52 | do_execsql_test 2.2 { SELECT count(*) FROM t1_segdir; } 35 |
| 53 | do_execsql_test 2.3 { INSERT INTO t1(t1) VALUES('optimize') } {} |
| 54 | do_execsql_test 2.4 { SELECT count(*) FROM t1_segdir; } 1 |
| 55 | |
| 56 | |
| 57 | sqlite3_enable_shared_cache $::enable_shared_cache |
| 58 | finish_test |