sqlite-vec/tests
Alex Garcia cb147c8834
Complete vec0 DELETE: zero data, reclaim empty chunks, fix metadata rc bug (#268)
When a row is deleted from a vec0 virtual table, the rowid slot in
_chunks.rowids and vector data in _vector_chunksNN.vectors are now
zeroed out (previously left as stale data, tracked in #54). When all
rows in a chunk are deleted (validity bitmap all zeros), the chunk and
its associated vector/metadata shadow table rows are reclaimed.

- Add vec0Update_Delete_ClearRowid to zero the rowid blob slot
- Add vec0Update_Delete_ClearVectors to zero all vector blob slots
- Add vec0Update_Delete_DeleteChunkIfEmpty to detect and delete
  fully-empty chunks from _chunks, _vector_chunksNN, _metadatachunksNN
- Fix missing rc check in ClearMetadata loop (bug: errors were silently
  ignored)
- Fix vec0_new_chunk to explicitly set _rowid_ on shadow table INSERTs
  (SHADOW_TABLE_ROWID_QUIRK: "rowid PRIMARY KEY" without INTEGER type
  is not a true rowid alias, causing blob_open failures after chunk
  delete+recreate cycles)
- Add 13 new tests covering rowid/vector zeroing, chunk reclamation,
  metadata/auxiliary/partition/text-PK/int8/bit variants, and
  page_count shrinkage verification
- Add vec0-delete-completeness fuzz target
- Update snapshots for new delete zeroing behavior

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 00:02:36 -07:00
..
__snapshots__ Complete vec0 DELETE: zero data, reclaim empty chunks, fix metadata rc bug (#268) 2026-03-17 00:02:36 -07:00
afbd Metadata filtering (#124) 2024-11-20 00:59:34 -08:00
correctness knn cleanups and tests 2024-07-05 12:07:45 -07:00
fuzz Complete vec0 DELETE: zero data, reclaim empty chunks, fix metadata rc bug (#268) 2026-03-17 00:02:36 -07:00
leak-fixtures fuzz work 2024-07-25 11:16:06 -07:00
minimum properly check SQLITE_THREADSAFE for static compilation 2024-08-09 13:23:18 -07:00
.gitignore Initial commit 2024-04-20 13:38:58 -07:00
.python-version PARTITION KEY support (#122) 2024-11-20 00:02:04 -08:00
build.rs Update test-unit.c and unittest.rs functions to enforce pre-existing behavior 2026-03-02 17:46:11 -08:00
Cargo.lock Initial commit 2024-04-20 13:38:58 -07:00
Cargo.toml Initial commit 2024-04-20 13:38:58 -07:00
conftest.py PARTITION KEY support (#122) 2024-11-20 00:02:04 -08:00
fuzz.py docs and fuzz 2024-07-16 22:28:15 -07:00
helpers.py Extract shared Python test utilities into tests/helpers.py 2026-03-02 20:05:21 -08:00
pyproject.toml PARTITION KEY support (#122) 2024-11-20 00:02:04 -08:00
skip.test-correctness.py PARTITION KEY support (#122) 2024-11-20 00:02:04 -08:00
sqlite-vec-internal.h Add LPAREN, RPAREN, COMMA token types to the scanner 2026-03-02 18:07:57 -08:00
test-auxiliary.py Extract shared Python test utilities into tests/helpers.py 2026-03-02 20:05:21 -08:00
test-general.py Extract shared Python test utilities into tests/helpers.py 2026-03-02 20:05:21 -08:00
test-insert-delete.py Complete vec0 DELETE: zero data, reclaim empty chunks, fix metadata rc bug (#268) 2026-03-17 00:02:36 -07:00
test-knn-distance-constraints.py Extract shared Python test utilities into tests/helpers.py 2026-03-02 20:05:21 -08:00
test-loadable.py --managed-python, fix flakey tests 2026-02-13 07:08:48 -08:00
test-metadata.py Extract shared Python test utilities into tests/helpers.py 2026-03-02 20:05:21 -08:00
test-partition-keys.py Extract shared Python test utilities into tests/helpers.py 2026-03-02 20:05:21 -08:00
test-unit.c Add LPAREN, RPAREN, COMMA token types to the scanner 2026-03-02 18:07:57 -08:00
test-wasm.mjs fmt 2024-07-31 12:55:46 -07:00
unittest.rs Update test-unit.c and unittest.rs functions to enforce pre-existing behavior 2026-03-02 17:46:11 -08:00
utils.py Initial commit 2024-04-20 13:38:58 -07:00
uv.lock PARTITION KEY support (#122) 2024-11-20 00:02:04 -08:00