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>
A
Alex Garcia committed
fe941716ad86363d6be99537db955305abb3ca61
Parent: 8b81f40