Skip to content

Commit e2de250

Browse files
committed
Revert "libsql: Wire up xCheckpointSeqCount"
This reverts commit bb7f011.
1 parent b272026 commit e2de250

File tree

9 files changed

+0
-68
lines changed

9 files changed

+0
-68
lines changed

libsql-replication/src/injector/sqlite_injector/injector_wal.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,6 @@ impl Wal for InjectorWal {
138138
self.inner.savepoint_undo(rollback_data)
139139
}
140140

141-
fn checkpoint_seq_count(&self) -> Result<u32> {
142-
self.inner.checkpoint_seq_count()
143-
}
144-
145141
fn frame_count(&self, locked: i32) -> Result<u32> {
146142
self.inner.frame_count(locked)
147143
}

libsql-sqlite3/test/rust_suite/src/virtual_wal.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,6 @@ mod tests {
106106
self.0.read_frame_raw(page_no, buffer)
107107
}
108108

109-
fn checkpoint_seq_count(&self) -> libsql_sys::wal::Result<u32> {
110-
self.0.checkpoint_seq_count()
111-
}
112-
113109
fn frame_count(&self, locked: i32) -> libsql_sys::wal::Result<u32> {
114110
self.0.frame_count(locked)
115111
}

libsql-storage/src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,6 @@ impl Wal for DurableWal {
270270
todo!()
271271
}
272272

273-
fn checkpoint_seq_count(&self) -> Result<u32> {
274-
todo!()
275-
}
276-
277273
fn frame_count(&self, _locked: i32) -> Result<u32> {
278274
todo!()
279275
}

libsql-sys/src/wal/either.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,6 @@ macro_rules! create_either {
8181
}
8282
}
8383

84-
fn checkpoint_seq_count(&self) -> super::Result<u32> {
85-
match self {
86-
$( $name::$t(inner) => inner.checkpoint_seq_count() ),*
87-
}
88-
}
89-
9084
fn frame_count(&self, locked: i32) -> super::Result<u32> {
9185
match self {
9286
$( $name::$t(inner) => inner.frame_count(locked) ),*

libsql-sys/src/wal/ffi.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ pub(crate) fn construct_libsql_wal<W: Wal>(wal: *mut W) -> libsql_wal {
3030
xUndo: Some(undo::<W>),
3131
xSavepoint: Some(savepoint::<W>),
3232
xSavepointUndo: Some(savepoint_undo::<W>),
33-
xCheckpointSeqCount: Some(checkpoint_seq_count::<W>),
3433
xFrameCount: Some(frame_count::<W>),
3534
xFrames: Some(frames::<W>),
3635
xCheckpoint: Some(checkpoint::<W>),
@@ -296,24 +295,6 @@ pub unsafe extern "C" fn savepoint_undo<T: Wal>(wal: *mut wal_impl, wal_data: *m
296295
}
297296
}
298297

299-
pub unsafe extern "C" fn checkpoint_seq_count<T: Wal>(
300-
wal: *mut wal_impl,
301-
out: *mut c_uint,
302-
) -> c_int {
303-
let this = &mut (*(wal as *mut T));
304-
match this.checkpoint_seq_count() {
305-
Ok(n) => {
306-
if !out.is_null() {
307-
unsafe {
308-
*out = n as _;
309-
}
310-
}
311-
SQLITE_OK
312-
}
313-
Err(code) => code.extended_code,
314-
}
315-
}
316-
317298
pub unsafe extern "C" fn frame_count<T: Wal>(
318299
wal: *mut wal_impl,
319300
locked: i32,

libsql-sys/src/wal/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,6 @@ pub trait Wal {
199199
fn savepoint(&mut self, rollback_data: &mut [u32]);
200200
fn savepoint_undo(&mut self, rollback_data: &mut [u32]) -> Result<()>;
201201

202-
fn checkpoint_seq_count(&self) -> Result<u32>;
203-
204202
fn frame_count(&self, locked: i32) -> Result<u32>;
205203

206204
/// Insert frames in the wal. On commit, returns the number of inserted frames for that

libsql-sys/src/wal/sqlite3_wal.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -288,18 +288,6 @@ impl Wal for Sqlite3Wal {
288288
}
289289
}
290290

291-
fn checkpoint_seq_count(&self) -> Result<u32> {
292-
let mut out: u32 = 0;
293-
let rc = unsafe {
294-
(self.inner.methods.xCheckpointSeqCount.unwrap())(self.inner.pData, &mut out)
295-
};
296-
if rc != 0 {
297-
Err(Error::new(rc))
298-
} else {
299-
Ok(out)
300-
}
301-
}
302-
303291
fn frame_count(&self, locked: i32) -> Result<u32> {
304292
let mut out: u32 = 0;
305293
let rc = unsafe {

libsql-sys/src/wal/wrapper.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,6 @@ impl<T: WrapWal<W>, W: Wal> Wal for WalRef<T, W> {
8989
unsafe { (*self.wrapper).savepoint_undo(&mut *self.wrapped, rollback_data) }
9090
}
9191

92-
fn checkpoint_seq_count(&self) -> super::Result<u32> {
93-
unsafe { (*self.wrapper).checkpoint_seq_count(&*self.wrapped) }
94-
}
95-
9692
fn frame_count(&self, locked: i32) -> super::Result<u32> {
9793
unsafe { (*self.wrapper).frame_count(&*self.wrapped, locked) }
9894
}
@@ -276,10 +272,6 @@ where
276272
.savepoint_undo(&mut self.wrapped, rollback_data)
277273
}
278274

279-
fn checkpoint_seq_count(&self) -> super::Result<u32> {
280-
self.wrapper.checkpoint_seq_count(&self.wrapped)
281-
}
282-
283275
fn frame_count(&self, locked: i32) -> super::Result<u32> {
284276
self.wrapper.frame_count(&self.wrapped, locked)
285277
}
@@ -417,10 +409,6 @@ pub trait WrapWal<W: Wal> {
417409
wrapped.savepoint_undo(rollback_data)
418410
}
419411

420-
fn checkpoint_seq_count(&self, wrapped: &W) -> super::Result<u32> {
421-
wrapped.checkpoint_seq_count()
422-
}
423-
424412
fn frame_count(&self, wrapped: &W, locked: i32) -> super::Result<u32> {
425413
wrapped.frame_count(locked)
426414
}

libsql-wal/src/wal.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -275,11 +275,6 @@ where
275275
}
276276
}
277277

278-
#[tracing::instrument(skip_all, fields(id = self.conn_id))]
279-
fn checkpoint_seq_count(&self) -> libsql_sys::wal::Result<u32> {
280-
Err(libsql_sys::wal::Error::new(10)) // SQLITE_IOERR
281-
}
282-
283278
#[tracing::instrument(skip_all, fields(id = self.conn_id))]
284279
fn frame_count(&self, _locked: i32) -> libsql_sys::wal::Result<u32> {
285280
Err(libsql_sys::wal::Error::new(10)) // SQLITE_IOERR

0 commit comments

Comments
 (0)