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 fts5faultD
19 # If SQLITE_ENABLE_FTS3 is defined, omit this file.
25 foreach_detail_mode $testprefix {
26 if {"%DETAIL%"=="none"} continue
29 CREATE VIRTUAL TABLE o1 USING fts5(a, b, c, detail=%DETAIL%);
30 INSERT INTO o1(o1, rank) VALUES('pgsz', 32);
32 WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<60 )
33 INSERT INTO o1 SELECT 'A', 'B', 'C' FROM s;
35 WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<60 )
36 INSERT INTO o1 SELECT 'C', 'A', 'B' FROM s;
38 WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<60 )
39 INSERT INTO o1 SELECT 'B', 'C', 'A' FROM s;
42 do_faultsim_test 1 -faults int* -prep {
45 execsql { SELECT count(*) FROM o1('a') }
47 faultsim_test_result {0 180} {1 {vtable constructor failed: o1}}
50 do_faultsim_test 2 -faults int* -prep {
53 execsql { SELECT * FROM o1('a:a AND {b c}:b') ORDER BY rank }
56 faultsim_test_result {0 1} {1 {vtable constructor failed: o1}}
59 do_faultsim_test 3 -faults int* -prep {
62 execsql { SELECT * FROM o1('{b c}:b NOT a:a') ORDER BY rank }
65 faultsim_test_result {0 1} {1 {vtable constructor failed: o1}}
68 do_faultsim_test 4 -faults int* -prep {
71 execsql { SELECT * FROM o1('b:b OR a:a') }
74 faultsim_test_result {0 1} {1 {vtable constructor failed: o1}}
77 do_faultsim_test 5 -faults int* -prep {
80 execsql { SELECT count(*) FROM o1('c:b') }
83 faultsim_test_result {0 1} {1 {vtable constructor failed: o1}}