Repository navigation
Expand file tree
/
Copy pathvec1update2.test
More file actions
61 lines (50 loc) · 1.46 KB
/
Copy pathvec1update2.test
File metadata and controls
61 lines (50 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# 2026-08-04
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
#***********************************************************************
#
#
source [file join [file dirname [info script]] vec1_common.tcl]
set testprefix vec1update2
vec1_load db
do_execsql_test 1.0 {
CREATE VIRTUAL TABLE v1 USING vec1(v, x);
WITH s(i) AS (
SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<200
)
INSERT INTO v1 SELECT random_vector(16), 'tag' || hex(randomblob(64)) FROM s;
INSERT INTO v1(cmd, arg) VALUES('blocksize', 2048);
INSERT INTO v1(cmd, arg) VALUES('rebuild', '{index:"flat"}');
}
do_execsql_test 1.1 {
SELECT sum(length(val)) FROM v1_idx;
SELECT sum(length(val)) FROM v1_meta;
} {13684 26656}
do_execsql_test 1.2 {
SELECT count(*) FROM v1_idx;
SELECT count(*) FROM v1_meta;
} {7 7}
do_execsql_test 1.3 {
UPDATE v1 SET v = random_vector(16);
UPDATE v1 SET v = random_vector(16);
UPDATE v1 SET v = random_vector(16);
UPDATE v1 SET v = random_vector(16);
}
do_execsql_test 1.4 {
SELECT count(*) FROM v1_idx;
SELECT count(*) FROM v1_meta;
} {7 7}
do_execsql_test 1.5 {
INSERT INTO v1(cmd, arg) VALUES('rebuild', '{index:"flat"}');
}
do_execsql_test 1.6 {
SELECT count(*) FROM v1_idx;
SELECT count(*) FROM v1_meta;
} {7 7}
finish_test