3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
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.
10 #*************************************************************************
12 # This file is focused on OOM errors.
15 source [file join [file dirname [info script]] fts5_common.tcl]
16 source $testdir/malloc_common.tcl
17 set testprefix fts5faultA
19 # If SQLITE_ENABLE_FTS3 is defined, omit this file.
25 foreach_detail_mode $testprefix {
27 CREATE VIRTUAL TABLE o1 USING fts5(a, detail=%DETAIL%);
28 INSERT INTO o1(o1, rank) VALUES('pgsz', 32);
30 WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<300 )
31 INSERT INTO o1 SELECT 'A B C' FROM s;
33 INSERT INTO o1 VALUES('A X C');
35 WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<300 )
36 INSERT INTO o1 SELECT 'A B C' FROM s;
39 do_faultsim_test 1 -faults oom* -prep {
42 execsql { SELECT rowid FROM o1('a NOT b') }
44 faultsim_test_result {0 301}
49 CREATE VIRTUAL TABLE o2 USING fts5(a);
51 INSERT INTO o2 VALUES('A B C');
52 WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<300 )
53 INSERT INTO o2 SELECT group_concat('A B C ') FROM s;
56 do_faultsim_test 2 -faults oom* -prep {
59 execsql { SELECT rowid FROM o2('a+b+c NOT xyz') }
61 faultsim_test_result {0 {1 2}}