Commit graph

1 commit

Author SHA1 Message Date
Alex Garcia
fe941716ad Finalize all cached vec0 stmts on commit (fixes #295)
vec0Sync only finalized stmtLatestChunk and the four stmtRowids* stmts.
The IVF/DiskANN/vectors stmts persisted on the vtab until xDisconnect,
which blocked sqlite3_close() (non-v2) with SQLITE_BUSY — the original
mozStorage case from #295. The same leak also broke VACUUM with
"SQL statements in progress" after any DiskANN operation.

Switch vec0Sync to call vec0_free_resources, which already finalizes
the full cache. Also fix a latent bug: the DiskANN block in
vec0_free_resources was nested inside #if SQLITE_VEC_EXPERIMENTAL_IVF_ENABLE,
so in the default build (DiskANN on, IVF off) those finalizes were
unreachable even from xDisconnect/xDestroy. Split into two independent
#if guards.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 23:49:05 -07:00