#9425·turso

MVCC: return a typed error instead of panicking in get_table_id_from_root_page_at

Author: KaianticsCreated Sep 30, 2026Updated Sep 30, 2026

get_table_id_from_root_page_at panics when a root page has no positive table-id mapping (mvcc/database/mod.rs:4657 at 0.8.1), and the non-passive cursor path calls it (mvcc/cursor.rs:599). I'd like it to return an error so an embedder gets an Err instead of a process abort.

I have no public-API reproduction: 240 runs across 0.7.0, 0.7.2 and 0.8.1 in #7949 never reached it. The cross-process case is unaffected; the second opener already gets a typed locking error there.

Proposed change: replace the panic! with the closest existing error variant, propagate it through the cursor path, and add a unit test that constructs the absent mapping and asserts the error. PR to follow; I'll use whichever variant you prefer.

Refs #7949.