Remove VRollback and VCommit as they are unused opcodes in sqlite

This commit is contained in:
PThorpe92
2025-11-09 11:27:09 -05:00
parent 94b6d254a9
commit b443b09516
4 changed files with 0 additions and 78 deletions

View File

@@ -564,8 +564,6 @@ Modifiers:
| VColumn | Yes | | | VColumn | Yes | |
| VCreate | Yes | | | VCreate | Yes | |
| VDestroy | Yes | | | VDestroy | Yes | |
| VRollback | Yes | |
| VCommit | Yes | |
| VFilter | Yes | | | VFilter | Yes | |
| VNext | Yes | | | VNext | Yes | |
| VOpen | Yes | | | VOpen | Yes | |

View File

@@ -1435,54 +1435,6 @@ pub fn op_vbegin(
Ok(InsnFunctionStepResult::Step) Ok(InsnFunctionStepResult::Step)
} }
pub fn op_vcommit(
program: &Program,
state: &mut ProgramState,
insn: &Insn,
pager: &Arc<Pager>,
mv_store: Option<&Arc<MvStore>>,
) -> Result<InsnFunctionStepResult> {
load_insn!(VCommit { cursor_id }, insn);
let cursor = state.get_cursor(*cursor_id);
let cursor = cursor.as_virtual_mut();
let vtab_id = cursor
.vtab_id()
.expect("VCommit on non ext-virtual table cursor");
let vtabs = &program.connection.syms.read().vtabs;
let vtab = vtabs
.iter()
.find(|p| p.1.id().eq(&vtab_id))
.expect("Could not find virtual table for VCommit");
program.connection.vtab_txn_states.write().remove(&vtab_id);
vtab.1.commit()?;
state.pc += 1;
Ok(InsnFunctionStepResult::Step)
}
pub fn op_vrollback(
program: &Program,
state: &mut ProgramState,
insn: &Insn,
pager: &Arc<Pager>,
mv_store: Option<&Arc<MvStore>>,
) -> Result<InsnFunctionStepResult> {
load_insn!(VRollback { cursor_id }, insn);
let cursor = state.get_cursor(*cursor_id);
let cursor = cursor.as_virtual_mut();
let vtabs = &program.connection.syms.read().vtabs;
let vtab = vtabs
.iter()
.find(|p| {
p.1.id().eq(&cursor
.vtab_id()
.expect("non ext-virtual table used in VRollback"))
})
.expect("Could not find virtual table for VRollback");
vtab.1.rollback()?;
state.pc += 1;
Ok(InsnFunctionStepResult::Step)
}
pub fn op_vrename( pub fn op_vrename(
program: &Program, program: &Program,
state: &mut ProgramState, state: &mut ProgramState,

View File

@@ -497,24 +497,6 @@ pub fn insn_to_row(
0, 0,
"".into() "".into()
), ),
Insn::VRollback{cursor_id} => (
"VRollback",
*cursor_id as i32,
0,
0,
Value::build_text(""),
0,
"".into(),
),
Insn::VCommit{cursor_id} => (
"VCommit",
*cursor_id as i32,
0,
0,
Value::build_text(""),
0,
"".into(),
),
Insn::VRename{cursor_id, new_name_reg} => ( Insn::VRename{cursor_id, new_name_reg} => (
"VRename", "VRename",
*cursor_id as i32, *cursor_id as i32,

View File

@@ -416,14 +416,6 @@ pub enum Insn {
/// The database within which this virtual table transaction needs to begin (P1). /// The database within which this virtual table transaction needs to begin (P1).
cursor_id: CursorID, cursor_id: CursorID,
}, },
VRollback {
/// The database within which this virtual table transaction needs to rollback (P1).
cursor_id: CursorID,
},
VCommit {
/// The database within which this virtual table transaction needs to commit (P1).
cursor_id: CursorID,
},
VRename { VRename {
/// The database within which this virtual table needs to be renamed (P1). /// The database within which this virtual table needs to be renamed (P1).
cursor_id: CursorID, cursor_id: CursorID,
@@ -1402,8 +1394,6 @@ impl InsnVariants {
InsnVariants::FkCounter => execute::op_fk_counter, InsnVariants::FkCounter => execute::op_fk_counter,
InsnVariants::FkIfZero => execute::op_fk_if_zero, InsnVariants::FkIfZero => execute::op_fk_if_zero,
InsnVariants::VBegin => execute::op_vbegin, InsnVariants::VBegin => execute::op_vbegin,
InsnVariants::VCommit => execute::op_vcommit,
InsnVariants::VRollback => execute::op_vrollback,
InsnVariants::VRename => execute::op_vrename, InsnVariants::VRename => execute::op_vrename,
} }
} }