mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-07 10:14:21 +01:00
alloc page1 on first tx (read OR write) - otherwise e.g. select * from sqlite_schema panics
This commit is contained in:
@@ -602,12 +602,16 @@ impl Pager {
|
||||
|
||||
#[inline(always)]
|
||||
pub fn begin_read_tx(&self) -> Result<LimboResult> {
|
||||
// We allocate the first page lazily in the first transaction
|
||||
if self.is_empty.load(Ordering::SeqCst) {
|
||||
self.allocate_page1()?;
|
||||
}
|
||||
self.wal.borrow_mut().begin_read_tx()
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn begin_write_tx(&self) -> Result<LimboResult> {
|
||||
// We allocate the first page lazily in the *first* write transaction
|
||||
// We allocate the first page lazily in the first transaction
|
||||
if self.is_empty.load(Ordering::SeqCst) {
|
||||
self.allocate_page1()?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user