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 / fts5corruptbig.test

53 lines · 1216 bytes Raw Blame History
1# 2025 October 13
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
17source [file join [file dirname [info script]] fts5_common.tcl]
18set testprefix fts5corruptbig
19
20# If SQLITE_ENABLE_FTS5 is not defined, omit this file.
21ifcapable !fts5 {
22 finish_test
23 return
24}
25
26if { $tcl_platform(wordSize)<8 } {
27 finish_test
28 return
29}
30
31if { $SQLITE_MAX_LENGTH!=0x7FFFFFFF } {
32 finish_test
33 return
34}
35
36do_execsql_test 1.0 {
37 CREATE VIRTUAL TABLE t1 USING fts5(x);
38}
39
40do_execsql_test 1.1 {
41 UPDATE t1_data SET block = zeroblob(2147483640) WHERE id=10;
42}
43
44do_execsql_test 1.2 {
45 SELECT id, length(block) FROM t1_data
46} {1 0 10 2147483640}
47
48do_catchsql_test 1.3 {
49 SELECT * FROM t1('abc')
50} {1 {out of memory}}
51
52finish_test
53