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/vec1overflow.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 / vec1overflow.test` 55 lines ยท 1622 bytes Raw Blame History 1 # 2026-10-06 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 # Test cases where a %_idx list is flushed to disk mid-transaction. 13 # 14 15 source [file join [file dirname [info script]] vec1_common.tcl] 16 set testprefix vec1overflow 17 vec1_load db 18 19 do_execsql_test 1.0 { 20 CREATE VIRTUAL TABLE v1 USING vec1(v); 21 CREATE TABLE t1(x); 22 WITH s(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<100) 23 INSERT INTO t1 SELECT random_vector(8) FROM s; 24 INSERT INTO v1(cmd, arg) VALUES('rebuild', ( 25 SELECT vec1_train(x, '{nbucket:1}') FROM t1 26 )); 27 INSERT INTO v1(rowid, v) SELECT rowid, x FROM t1; 28 } 29 30 do_execsql_test 1.1 { 31 INSERT INTO v1(rowid, v) VALUES(`4294967296`, random_vector(8)); 32 PRAGMA integrity_check; 33 } {ok} 34 35 reset_db 36 vec1_load db 37 do_execsql_test 2.0 { 38 CREATE VIRTUAL TABLE v1 USING vec1(v); 39 CREATE TABLE t1(x); 40 WITH s(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<100) 41 INSERT INTO t1 SELECT random_vector(8) FROM s; 42 INSERT INTO v1(cmd, arg) VALUES('rebuild', ( 43 SELECT vec1_train(x, '{nbucket:1}') FROM t1 44 )); 45 INSERT INTO v1(cmd, arg) VALUES('blocksize', 1024); 46 } 47 48 do_execsql_test 2.1 { 49 WITH s(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<200) 50 INSERT INTO v1(rowid, v) SELECT i, random_vector(8) FROM s; 51 SELECT count(*)>1 FROM v1_idx; 52 PRAGMA integrity_check; 53 } {1 ok} 54 55 finish_test