mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
pragma_index_info reports key column names but not per-key collation or sort direction, so a named non-partial index with the exact ordered columns but COLLATE NOCASE on a key was certified by M4's shape check even though the binary-equality prune-age query cannot use it (the plan falls back to the PK autoindex plus a temp B-tree sort). Switch key-shape validation to pragma_index_xinfo as the single source of key semantics, asserting name + BINARY collation + ascending direction; index_list stays only for ownership and partiality. A wrong-collation index is dropped and rebuilt inside M4's BEGIN IMMEDIATE like any other wrong shape. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>