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 fts5faultE
19 # If SQLITE_ENABLE_FTS5 is not defined, omit this file.
25 faultsim_save_and_close
26 do_faultsim_test 1 -prep {
27 faultsim_restore_and_reopen
29 execsql { CREATE VIRTUAL TABLE t1 USING fts5(x, y, tokenize=trigram) }
31 faultsim_test_result {0 {}} {1 {vtable constructor failed: t1}}
36 CREATE VIRTUAL TABLE t1 USING fts5(x, y, tokenize=trigram);
39 faultsim_save_and_close
40 do_faultsim_test 2 -prep {
41 faultsim_restore_and_reopen
44 INSERT INTO t1 VALUES('abcdefghijklmnopqrstuvwxyz', NULL);
45 SELECT count(*) FROM t1 WHERE x LIKE '%mnop%' AND t1 MATCH 'jkl';
48 faultsim_test_result {0 1} {1 {vtable constructor failed: t1}}
53 CREATE VIRTUAL TABLE t1 USING fts5(x, y, tokenize=trigram, detail=none);
54 INSERT INTO t1 VALUES('abcdefghijklmnopqrstuvwxyz', NULL);
57 faultsim_save_and_close
58 do_faultsim_test 3 -prep {
59 faultsim_restore_and_reopen
62 SELECT count(*) FROM t1 WHERE x LIKE '%mnopqrs%' AND t1 MATCH 'abc'
65 faultsim_test_result {0 1} {1 {vtable constructor failed: t1}}