sqlite
[Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI.
Brought by drakestapleton
sqlite / ext / fts5 / test / fts5optimize2.test
| 1 | # 2014 Dec 20 |
| 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 | # |
| 12 | # TESTRUNNER: superslow |
| 13 | # |
| 14 | |
| 15 | source [file join [file dirname [info script]] fts5_common.tcl] |
| 16 | set testprefix fts5optimize2 |
| 17 | |
| 18 | # If SQLITE_ENABLE_FTS5 is not defined, omit this file. |
| 19 | ifcapable !fts5 { |
| 20 | finish_test |
| 21 | return |
| 22 | } |
| 23 | |
| 24 | set nLoop 2500 |
| 25 | |
| 26 | do_execsql_test 1.0 { |
| 27 | CREATE VIRTUAL TABLE t1 USING fts5(x); |
| 28 | INSERT INTO t1(t1, rank) VALUES('pgsz', 32); |
| 29 | } |
| 30 | |
| 31 | do_test 1.1 { |
| 32 | for {set ii 0} {$ii < $nLoop} {incr ii} { |
| 33 | execsql { |
| 34 | INSERT INTO t1 VALUES('abc def ghi'); |
| 35 | INSERT INTO t1 VALUES('jkl mno pqr'); |
| 36 | INSERT INTO t1(t1) VALUES('optimize'); |
| 37 | } |
| 38 | } |
| 39 | } {} |
| 40 | |
| 41 | do_execsql_test 1.2 { |
| 42 | SELECT count(*) FROM t1('mno') |
| 43 | } $nLoop |
| 44 | |
| 45 | finish_test |