From 7f8f1bc07444941cc3d942a1f4cfad9c23ceed3e Mon Sep 17 00:00:00 2001 From: Sumit Patel Date: Sat, 25 Oct 2025 16:53:59 +0530 Subject: [PATCH] Update the write_varint method to use an encoded buffer of size 9 instead of 10. The SQLite varint specification states that the varint is guaranteed to be a maximum of 9 bytes, but our version of write_varint initializes a buffer of 10 bytes. Changing the size to match the specification. --- core/storage/sqlite3_ondisk.rs | 2 +- tests/integration/query_processing/test_btree.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/storage/sqlite3_ondisk.rs b/core/storage/sqlite3_ondisk.rs index 190b94479..93f897dc1 100644 --- a/core/storage/sqlite3_ondisk.rs +++ b/core/storage/sqlite3_ondisk.rs @@ -1601,7 +1601,7 @@ pub fn write_varint(buf: &mut [u8], value: u64) -> usize { return 9; } - let mut encoded: [u8; 10] = [0; 10]; + let mut encoded: [u8; 9] = [0; 9]; let mut bytes = value; let mut n = 0; while bytes != 0 { diff --git a/tests/integration/query_processing/test_btree.rs b/tests/integration/query_processing/test_btree.rs index e55c512f0..c24d025d6 100644 --- a/tests/integration/query_processing/test_btree.rs +++ b/tests/integration/query_processing/test_btree.rs @@ -130,7 +130,7 @@ pub fn write_varint(buf: &mut [u8], value: u64) -> usize { return 9; } - let mut encoded: [u8; 10] = [0; 10]; + let mut encoded: [u8; 9] = [0; 9]; let mut bytes = value; let mut n = 0; while bytes != 0 {