mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
`pragma_index_info` reports an index's key columns but not whether it carries a `WHERE` predicate, so a partial index with the exact expected columns passed `scope_age_index_is_correct` and M4 wrote its marker over it. That index cannot serve the unrestricted scope-age range scan the Phase-2 prune query needs — SQLite falls back to the primary-key autoindex — so the marker would certify a missing access path. Probe `pragma_index_list`'s `partial` flag inside the same `BEGIN IMMEDIATE` transaction and treat a partial named age index like any other wrong shape: drop and rebuild it non-partial (an index carries no data, so a rebuild is safe). A mutation-sensitive test precreates a partial index with correct table and ordered columns and asserts M4 replaces it with a non-partial index before committing the marker. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>