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 / vec1update2.test

61 lines · 1490 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
14source [file join [file dirname [info script]] vec1_common.tcl]
15set testprefix vec1update2
16vec1_load db
17
18do_execsql_test 1.0 {
19 CREATE VIRTUAL TABLE v1 USING vec1(v, x);
20 WITH s(i) AS (
21 SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<200
22 )
23 INSERT INTO v1 SELECT random_vector(16), 'tag' || hex(randomblob(64)) FROM s;
24 INSERT INTO v1(cmd, arg) VALUES('blocksize', 2048);
25 INSERT INTO v1(cmd, arg) VALUES('rebuild', '{index:"flat"}');
26}
27
28do_execsql_test 1.1 {
29 SELECT sum(length(val)) FROM v1_idx;
30 SELECT sum(length(val)) FROM v1_meta;
31} {13684 26656}
32
33do_execsql_test 1.2 {
34 SELECT count(*) FROM v1_idx;
35 SELECT count(*) FROM v1_meta;
36} {7 7}
37
38do_execsql_test 1.3 {
39 UPDATE v1 SET v = random_vector(16);
40 UPDATE v1 SET v = random_vector(16);
41 UPDATE v1 SET v = random_vector(16);
42 UPDATE v1 SET v = random_vector(16);
43}
44
45do_execsql_test 1.4 {
46 SELECT count(*) FROM v1_idx;
47 SELECT count(*) FROM v1_meta;
48} {7 7}
49
50do_execsql_test 1.5 {
51 INSERT INTO v1(cmd, arg) VALUES('rebuild', '{index:"flat"}');
52}
53
54do_execsql_test 1.6 {
55 SELECT count(*) FROM v1_idx;
56 SELECT count(*) FROM v1_meta;
57} {7 7}
58
59
60finish_test
61