mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-18 23:54:19 +01:00
Fix read frame setting wrong offset
When I added frame reading support I thought, okay, who cares about the page id of this page it we read it from a frame because we don't need it to compute the offset to read from the file in this case. Fuck me, because it was needed in case we read `page 1` from WAL because it has a differnt `offset`.
This commit is contained in:
@@ -1308,7 +1308,7 @@ pub fn begin_read_wal_frame(
|
||||
let frame = page.clone();
|
||||
let complete = Box::new(move |buf: Arc<RefCell<Buffer>>| {
|
||||
let frame = frame.clone();
|
||||
finish_read_page(2, buf, frame).unwrap();
|
||||
finish_read_page(page.get().id, buf, frame).unwrap();
|
||||
});
|
||||
let c = Completion::Read(ReadCompletion::new(buf, complete));
|
||||
io.pread(offset, c)?;
|
||||
|
||||
Reference in New Issue
Block a user