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 / vec1 / test / vec1fault2.test

49 lines · 1265 bytes Raw Blame History
1# 2026-04-01
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#
13
14source [file join [file dirname [info script]] vec1_common.tcl]
15set testprefix vec1fault2
16
17#-------------------------------------------------------------------------
18# OOM error in multi-threaded 'rebuild'.
19#
20reset_db
21vec1_load db
22
23do_execsql_test 1.0 {
24 CREATE VIRTUAL TABLE mytbl USING vec1(a, b);
25 WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<600 )
26 INSERT INTO mytbl SELECT random_vector(8), i FROM s;
27}
28faultsim_save_and_close
29
30proc progress {percent msg} { }
31
32do_faultsim_test 1 -faults oom-t* -prep {
33 faultsim_restore_and_reopen
34 vec1_load db
35 db func progress progress
36 db eval { PRAGMA table_info = mytbl }
37 db eval { SELECT vec1_config('nthread', 2) }
38} -body {
39 execsql {
40 INSERT INTO mytbl(cmd, arg) VALUES('rebuild', (
41 SELECT vec1_train(a, '{codesize:8, progress: "progress"}') FROM mytbl
42 ));
43 }
44} -test {
45 faultsim_test_result {0 {}}
46}
47
48finish_test
49