sqlite
[Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI.
Brought by drakestapleton
sqlite / ext / vec1 / test / vec1fault5.test
| 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 | |
| 14 | source [file join [file dirname [info script]] vec1_common.tcl] |
| 15 | set testprefix vec1fault5 |
| 16 | vec1_load db |
| 17 | |
| 18 | do_execsql_test 1.0 { |
| 19 | CREATE TABLE t1(a); |
| 20 | WITH s(i) AS ( |
| 21 | SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<512 |
| 22 | ) INSERT INTO t1 SELECT random_vector(16) FROM s; |
| 23 | } |
| 24 | do_execsql_test 1.1 { |
| 25 | SELECT min(length(a)) FROM t1 |
| 26 | } 64 |
| 27 | |
| 28 | do_execsql_test 1.2 { |
| 29 | SELECT length( vec1_train(a, '{codesize:8, opq:1, nopq_round:2,nbucket:2}') ) FROM t1; |
| 30 | } {17560} |
| 31 | |
| 32 | do_faultsim_test 1.3 -faults oom-t* -prep { |
| 33 | } -body { |
| 34 | execsql { |
| 35 | SELECT length( vec1_train(a, '{codesize:8, opq:1, nopq_round:2,nbucket:2}') ) FROM t1; |
| 36 | } |
| 37 | } -test { |
| 38 | faultsim_test_result {0 17560} |
| 39 | } |
| 40 | |
| 41 | finish_test |
| 42 |