From 515e2814801850c6c2743ff9f539051102e95451 Mon Sep 17 00:00:00 2001 From: pedrocarlo Date: Sun, 26 Jan 2025 20:49:23 -0300 Subject: [PATCH 1/2] implement noop --- COMPAT.md | 2 +- core/vdbe/explain.rs | 9 +++++++++ core/vdbe/insn.rs | 2 ++ core/vdbe/mod.rs | 5 +++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/COMPAT.md b/COMPAT.md index d7c8b0a2c..a2e12f059 100644 --- a/COMPAT.md +++ b/COMPAT.md @@ -485,7 +485,7 @@ Modifiers: | Next | No | | NextAsync | Yes | | NextAwait | Yes | -| Noop | No | +| Noop | Yes | | Not | Yes | | NotExists | Yes | | NotFound | No | diff --git a/core/vdbe/explain.rs b/core/vdbe/explain.rs index 89967608a..7e3dcfe2f 100644 --- a/core/vdbe/explain.rs +++ b/core/vdbe/explain.rs @@ -1138,6 +1138,15 @@ pub fn insn_to_str( 0, format!("r[{}]=(r[{}] || r[{}])", dest, lhs, rhs), ), + Insn::Noop => ( + "Noop", + 0, + 0, + 0, + OwnedValue::build_text(Rc::new("".to_string())), + 0, + format!(""), + ), }; format!( "{:<4} {:<17} {:<4} {:<4} {:<4} {:<13} {:<2} {}", diff --git a/core/vdbe/insn.rs b/core/vdbe/insn.rs index f17a1a354..25810d151 100644 --- a/core/vdbe/insn.rs +++ b/core/vdbe/insn.rs @@ -563,6 +563,8 @@ pub enum Insn { rhs: usize, dest: usize, }, + Noop, + } fn cast_text_to_numerical(value: &str) -> OwnedValue { diff --git a/core/vdbe/mod.rs b/core/vdbe/mod.rs index 36cc8e4cb..f05268eab 100644 --- a/core/vdbe/mod.rs +++ b/core/vdbe/mod.rs @@ -2387,6 +2387,11 @@ impl Program { exec_or(&state.registers[*lhs], &state.registers[*rhs]); state.pc += 1; } + Insn::Noop => { + // Do nothing + // Advance the program counter for the next opcode + state.pc += 1 + } } } } From 97c716524bd5f0a78f86093cceeca5de5aef9d07 Mon Sep 17 00:00:00 2001 From: pedrocarlo Date: Sun, 26 Jan 2025 20:51:14 -0300 Subject: [PATCH 2/2] cargo fmt and clippy --- core/vdbe/explain.rs | 2 +- core/vdbe/insn.rs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/core/vdbe/explain.rs b/core/vdbe/explain.rs index 7e3dcfe2f..17a54e427 100644 --- a/core/vdbe/explain.rs +++ b/core/vdbe/explain.rs @@ -1145,7 +1145,7 @@ pub fn insn_to_str( 0, OwnedValue::build_text(Rc::new("".to_string())), 0, - format!(""), + String::new(), ), }; format!( diff --git a/core/vdbe/insn.rs b/core/vdbe/insn.rs index 25810d151..81cec11fa 100644 --- a/core/vdbe/insn.rs +++ b/core/vdbe/insn.rs @@ -564,7 +564,6 @@ pub enum Insn { dest: usize, }, Noop, - } fn cast_text_to_numerical(value: &str) -> OwnedValue {