mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-17 00:24:21 +01:00
Remove VRollback and VCommit as they are unused opcodes in sqlite
This commit is contained in:
@@ -564,8 +564,6 @@ Modifiers:
|
||||
| VColumn | Yes | |
|
||||
| VCreate | Yes | |
|
||||
| VDestroy | Yes | |
|
||||
| VRollback | Yes | |
|
||||
| VCommit | Yes | |
|
||||
| VFilter | Yes | |
|
||||
| VNext | Yes | |
|
||||
| VOpen | Yes | |
|
||||
|
||||
@@ -1435,54 +1435,6 @@ pub fn op_vbegin(
|
||||
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(
|
||||
program: &Program,
|
||||
state: &mut ProgramState,
|
||||
|
||||
@@ -497,24 +497,6 @@ pub fn insn_to_row(
|
||||
0,
|
||||
"".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} => (
|
||||
"VRename",
|
||||
*cursor_id as i32,
|
||||
|
||||
@@ -416,14 +416,6 @@ pub enum Insn {
|
||||
/// The database within which this virtual table transaction needs to begin (P1).
|
||||
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 {
|
||||
/// The database within which this virtual table needs to be renamed (P1).
|
||||
cursor_id: CursorID,
|
||||
@@ -1402,8 +1394,6 @@ impl InsnVariants {
|
||||
InsnVariants::FkCounter => execute::op_fk_counter,
|
||||
InsnVariants::FkIfZero => execute::op_fk_if_zero,
|
||||
InsnVariants::VBegin => execute::op_vbegin,
|
||||
InsnVariants::VCommit => execute::op_vcommit,
|
||||
InsnVariants::VRollback => execute::op_vrollback,
|
||||
InsnVariants::VRename => execute::op_vrename,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user