mirror of
https://github.com/clockworklabs/SpacetimeDB.git
synced 2026-05-10 01:30:37 -04:00
0cb23814d3
## Description of Changes One-line fix in `system_tables.rs`: when reading indexes back from `st_index`, `StIndexAlgorithm::Hash` was incorrectly converted to `BTreeAlgorithm` instead of `HashAlgorithm`. This caused `check_compatible` to fail with `Index algorithm mismatch` on **any** republish of a module containing hash indexes — the database schema would report BTree while the module def specified Hash. Effectively, any database with a hash index was stuck and could not be updated. ### Root Cause `system_tables.rs:1234` in the `From<StIndexAlgorithm> for IndexAlgorithm` impl: ```rust // Before (bug — introduced in #3976): StIndexAlgorithm::Hash { columns } => BTreeAlgorithm { columns }.into(), // After (fix): StIndexAlgorithm::Hash { columns } => HashAlgorithm { columns }.into(), ``` The PR that added hash indices (#3976) imported `HashAlgorithm` but used `BTreeAlgorithm` for the Hash variant conversion. ## API and ABI breaking changes None. ## Expected complexity level and risk 1 — single word change, restores correct behavior. ## Testing Existing schema tests cover index round-trips. The bug was caught by attempting to republish a module with hash indexes. --------- Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>