alloc page1 on first tx (read OR write) - otherwise e.g. select * from sqlite_schema panics

This commit is contained in:
Jussi Saurio
2025-06-18 08:19:04 +03:00
committed by Diego Reis
parent d05030ed64
commit 8d4ed110c0

View File

@@ -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()?;
}