Files
clockwork-labs-bot 0cb23814d3 Fix hash index round-trip through st_indexes (#4336)
## 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>
2026-02-18 06:14:34 +00:00
..
2026-02-17 10:15:15 +00:00
2026-02-06 19:51:53 +00:00