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 / fts5bigpl.test
| 1 | # 2015 April 21 |
| 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 | # This test is focused on really large position lists. Those that require |
| 13 | # 4 or 5 byte position-list size varints. Because of the amount of memory |
| 14 | # required, these tests only run on 64-bit platforms. |
| 15 | # |
| 16 | |
| 17 | source [file join [file dirname [info script]] fts5_common.tcl] |
| 18 | set testprefix fts5bigpl |
| 19 | |
| 20 | # If SQLITE_ENABLE_FTS5 is not defined, omit this file. |
| 21 | ifcapable !fts5 { |
| 22 | finish_test |
| 23 | return |
| 24 | } |
| 25 | |
| 26 | if { $tcl_platform(wordSize)<8 } { |
| 27 | finish_test |
| 28 | return |
| 29 | } |
| 30 | |
| 31 | do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(x) } |
| 32 | |
| 33 | do_test 1.1 { |
| 34 | foreach t {a b c d e f g h i j} { |
| 35 | set doc [string repeat "$t " 1200000] |
| 36 | execsql { INSERT INTO t1 VALUES($doc) } |
| 37 | } |
| 38 | execsql { INSERT INTO t1(t1) VALUES('integrity-check') } |
| 39 | } {} |
| 40 | |
| 41 | do_test 1.2 { |
| 42 | execsql { DELETE FROM t1 } |
| 43 | foreach t {"a b" "b a" "c d" "d c"} { |
| 44 | set doc [string repeat "$t " 600000] |
| 45 | execsql { INSERT INTO t1 VALUES($doc) } |
| 46 | } |
| 47 | execsql { INSERT INTO t1(t1) VALUES('integrity-check') } |
| 48 | } {} |
| 49 | |
| 50 | |
| 51 | # 5-byte varint. This test takes 30 seconds or so on a 2014 workstation. |
| 52 | # The generated database is roughly 635MiB. |
| 53 | # |
| 54 | do_test 2.1...slow { |
| 55 | execsql { DELETE FROM t1 } |
| 56 | foreach t {a} { |
| 57 | set doc [string repeat "$t " 150000000] |
| 58 | execsql { INSERT INTO t1 VALUES($doc) } |
| 59 | } |
| 60 | execsql { INSERT INTO t1(t1) VALUES('integrity-check') } |
| 61 | } {} |
| 62 | |
| 63 | finish_test |