Commit fe94171
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>1 parent 8b81f40 commit fe94171
2 files changed
Lines changed: 38 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3695 | 3695 | | |
3696 | 3696 | | |
3697 | 3697 | | |
| 3698 | + | |
| 3699 | + | |
3698 | 3700 | | |
| 3701 | + | |
3699 | 3702 | | |
3700 | 3703 | | |
3701 | 3704 | | |
3702 | 3705 | | |
3703 | 3706 | | |
3704 | | - | |
3705 | 3707 | | |
3706 | 3708 | | |
3707 | 3709 | | |
| |||
10370 | 10372 | | |
10371 | 10373 | | |
10372 | 10374 | | |
10373 | | - | |
10374 | | - | |
10375 | | - | |
10376 | | - | |
10377 | | - | |
10378 | | - | |
10379 | | - | |
10380 | | - | |
10381 | | - | |
10382 | | - | |
10383 | | - | |
10384 | | - | |
10385 | | - | |
10386 | | - | |
10387 | | - | |
10388 | | - | |
10389 | | - | |
10390 | | - | |
10391 | | - | |
10392 | | - | |
10393 | | - | |
10394 | | - | |
| 10375 | + | |
10395 | 10376 | | |
10396 | 10377 | | |
10397 | 10378 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
0 commit comments