Skip to content

Commit 27b3fc4

Browse files
committed
add anti-hacker test
1 parent 644a91e commit 27b3fc4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libsql-sqlite3/test/libsql_vector_index.test

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,11 @@ do_execsql_test vector-index-attach-query {
532532
SELECT * FROM vector_top_k('t.t_attach_idx', vector('[3,4,5]'), 4);
533533
} {3 4 2 1}
534534

535+
# protect binary file with test in order to make it more explicit when someone change it (expclitily or not; with malicious intent or not)
536+
do_test vector-index-v2-anti-hacker-check {
537+
md5file libsql_vector_index_v2.db
538+
} {dcd33c78fc2bc53bb8e60236b418711a}
539+
535540
# v2.db created with simple command (with LibSQL built from commit 4a5f373a298cc751d9ca56662eaaf879eefff279):
536541
# ./sqlite3 v2.db --cmd "CREATE TABLE t (id TEXT, e FLOAT32(4)); CREATE INDEX t_idx ON t (libsql_vector_idx(e)); INSERT INTO t VALUES ('a', vector32('[1,2,3,4]')), ('b', vector32('[-100,-100,-100,-100]')), ('c', vector32('[10,10,-10,-10]')), ('d', vector32('[-1,2,3,4]'))"
537542
sqlite3 dbv2 libsql_vector_index_v2.db

0 commit comments

Comments
 (0)