add link to sqlite source about payload_overflows()

This commit is contained in:
jussisaurio
2024-12-23 21:12:40 +02:00
parent b57a95752c
commit c417fe7880
2 changed files with 2 additions and 0 deletions

View File

@@ -1494,6 +1494,7 @@ impl BTreeCursor {
log::debug!("fill_cell_payload(overflow)");
let payload_overflow_threshold_min = self.payload_overflow_threshold_min(page_type);
// see e.g. https://github.com/sqlite/sqlite/blob/9591d3fe93936533c8c3b0dc4d025ac999539e11/src/dbstat.c#L371
let mut space_left = payload_overflow_threshold_min
+ (record_buf.len() - payload_overflow_threshold_min) % (self.usable_space() - 4);

View File

@@ -1274,6 +1274,7 @@ pub fn begin_write_wal_header(io: &Rc<dyn File>, header: &WalHeader) -> Result<(
/// Checks if payload will overflow a cell based on the maximum allowed size.
/// It will return the min size that will be stored in that case,
/// including overflow pointer
/// see e.g. https://github.com/sqlite/sqlite/blob/9591d3fe93936533c8c3b0dc4d025ac999539e11/src/dbstat.c#L371
pub fn payload_overflows(
payload_size: usize,
payload_overflow_threshold_max: usize,