interplane.Get Omega
Read in your language

sqlite

[Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI.

Brought by drakestapleton

branch master Branches Tags History

sqlite / ext / fts5 / test / fts5bigid.test

62 lines · 1442 bytes Raw Blame History
1# 2023 May 28
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
13source [file join [file dirname [info script]] fts5_common.tcl]
14set testprefix fts5bigid
15
16# If SQLITE_ENABLE_FTS5 is not defined, omit this file.
17ifcapable !fts5 {
18 finish_test
19 return
20}
21
22set nRow 20000
23
24proc do_ascdesc_test {tn query} {
25 set ::lAsc [db eval { SELECT rowid FROM x1($query) }]
26 set ::lDesc [db eval { SELECT rowid FROM x1($query) ORDER BY rowid DESC }]
27 do_test $tn.1 { lsort -integer $::lAsc } $::lAsc
28 do_test $tn.2 { lsort -integer -decr $::lDesc } $::lDesc
29 do_test $tn.3 { lsort -integer $::lDesc } $::lAsc
30}
31
32do_execsql_test 1.0 {
33 CREATE VIRTUAL TABLE x1 USING fts5(a);
34}
35
36do_test 1.1 {
37 for {set ii 0} {$ii < $nRow} {incr ii} {
38 db eval {
39 REPLACE INTO x1(rowid, a) VALUES(random(), 'movement at the station');
40 }
41 }
42} {}
43
44do_ascdesc_test 1.2 "the"
45
46do_execsql_test 1.3 {
47 DELETE FROM x1
48}
49
50do_test 1.4 {
51 for {set ii 0} {$ii < $nRow} {incr ii} {
52 db eval {
53 INSERT INTO x1(rowid, a) VALUES(
54 $ii + 0x6FFFFFFFFFFFFFFF, 'movement at the station'
55 );
56 }
57 }
58} {}
59
60do_ascdesc_test 1.5 "movement"
61
62finish_test