mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-30 05:14:23 +01:00
This PR partially fixes issue when schema changes were invisible after WAL sync calls. Now, `wal_insert_end` always read fresh schema cookie and re-parse schema from scratch if cookie changed. Generally, the problem of "silent" schema update can be more generic if(when?) `turso-db` will support multi-process setup. But for now only single-process can work with `turso-db`, so I decided to inject re-parse logic explicitly in WAL raw API in order to not introduce any unnecessary overhead in the ordinary execution path. This fix is not complete, as if we will have already prepared statements - they should be re-prepared too in case of schema changes. But this problem already tracked in the PR https://github.com/tursodatabase/turso/pull/2214 Reviewed-by: Pedro Muniz (@pedrocarlo) Closes #2246
Integration and regression test suite.
# run all tests
cargo test
# run individual test
cargo test test_sequential_write -- --nocapture