Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/sqlite/blob/master/ext/vec1/test/vec1nan.test # sqlite [Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `sqlite / ext / vec1 / test / vec1nan.test` 48 lines ยท 1293 bytes Raw Blame History 1 # 2026-08-04 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 vec1nan 16 vec1_load db 17 18 do_execsql_test 1.0 { 19 CREATE VIRTUAL TABLE vv USING vec1(v); 20 } 21 do_execsql_test 1.1 { 22 SELECT * FROM vv( vec1_from_json('[1,2,3,4,5,6,7,8,9]'), 10); 23 } {} 24 25 do_catchsql_test 1.2 { 26 SELECT * FROM vv(vec1_from_json('[1,2,3,4,5,6,7,8,NaN]'), 10); 27 } {1 {vec1: non-finite value not allowed in vector}} 28 29 do_catchsql_test 1.3 { 30 INSERT INTO vv(v) VALUES(vec1_from_json('[1,2,3,4,NaN,5,6,7,8,9]')); 31 } {1 {vec1: non-finite value not allowed in vector}} 32 33 do_execsql_test 1.4 { 34 CREATE TABLE tr(x); 35 WITH s(i) AS ( 36 VALUES(1) UNION ALL SELECT i+1 FROM s WHERE i<1000 37 ) 38 INSERT INTO tr SELECT random_vector(9) FROM s; 39 INSERT INTO tr(x) VALUES(vec1_from_json('[1,2,3,4,NaN,5,6,7,8]')); 40 } 41 42 do_catchsql_test 1.5 { 43 SELECT vec1_train(x, '{codesize:4}') FROM tr 44 } {1 {vec1_train: non-finite value not allowed in vector}} 45 46 47 finish_test 48