SIGN IN SIGN UP

Fix SQLITE_DONE leak in ClearMetadata that broke DELETE on long text metadata (#274) (#275)

vec0Update_Delete_ClearMetadata's long-text branch runs a DELETE via
sqlite3_step, which returns SQLITE_DONE (101) on success. The code
checked for failure but never normalized the success case to SQLITE_OK.
The function's epilogue returned SQLITE_DONE as-is, which the caller
(vec0Update_Delete) treated as an error, aborting the DELETE scan and
silently leaving rows behind.

- Normalize rc to SQLITE_OK after successful sqlite3_step in ClearMetadata
- Move sqlite3_finalize before the rc check (cleanup on all paths)
- Add test_delete_by_metadata_with_long_text regression test
- Update test_deletes snapshot (row 3 now correctly deleted)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
A
Alex Garcia committed
ee9bd2ba4d77e6d9782db7ede5accf549235403b
Parent: dfd8dc5
Committed by GitHub <noreply@github.com> on 3/30/2026, 11:39:59 PM