Commit graph

3 commits

Author SHA1 Message Date
Alex Garcia
8b81f40d1e Rename all IVF shadow tables in vec0Rename
vec0Rename only emitted ALTER TABLE on `<name>_ivf_cells%02d`, so renaming
an IVF-indexed vec0 table left `_ivf_centroids`, `_ivf_rowid_map`, and
`_ivf_vectors` (when quantizer != none) with the old prefix. Subsequent
queries against the renamed table broke, and DROP TABLE left those three
shadows orphaned in the schema. Same shape as the DiskANN/rescore bug fixed
in #294, just for the IVF branch.

Mirror ivf_create_shadow_tables: emit ALTER for all four IVF shadows,
gating `_ivf_vectors` on quantizer != VEC0_IVF_QUANTIZER_NONE.

Adds test-ivf-rename.py (auto-skipped on default builds via conftest's
test-ivf prefix rule) covering quantizer=none, quantizer=binary, and
DROP-after-rename. Also adds a rescore rename regression test to
test-rename.py to lock down the (already-correct) rescore path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 23:09:27 -07:00
Rolf Rando
8105eee61e
Skip _vector_chunks rename for non-FLAT vec0 columns (#294)
vec0Rename emits an unconditional ALTER TABLE on `<name>_vector_chunks%02d`
for every vector column, but non-FLAT columns (rescore, IVF, DiskANN) don't
create that shadow table — so ALTER TABLE RENAME on a DiskANN-indexed (or
rescore/IVF) vec0 table fails with `no such table` and leaves any cached
prepared statements still referencing the old name.

Mirror the guard already used at create time in vec0_init around
VEC0_SHADOW_VECTOR_N_CREATE: only rename `_vector_chunks` when the column's
index_type is VEC0_INDEX_TYPE_FLAT.

Adds a regression test exercising rename on a DiskANN-indexed table.
2026-05-17 22:56:52 -07:00
Alex Garcia
c5607100ab Implement xRename for vec0 virtual table (fixes #43)
Enables ALTER TABLE RENAME on vec0 tables by renaming all shadow tables
(info, rowids, chunks, auxiliary, vector_chunks, metadata, rescore,
diskann, ivf) and updating cached names and prepared statements.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 23:01:29 -07:00