From 8cd2e82d021d353b0e0a1d74d312d44959e6ef2c Mon Sep 17 00:00:00 2001 From: Diego Reis Date: Fri, 31 Jan 2025 18:33:36 -0300 Subject: [PATCH] Update macro name to --- core/vdbe/mod.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/core/vdbe/mod.rs b/core/vdbe/mod.rs index ddfc98d99..fa477f377 100644 --- a/core/vdbe/mod.rs +++ b/core/vdbe/mod.rs @@ -376,7 +376,7 @@ impl ProgramState { } } -macro_rules! must_be_btree_cursor { +macro_rules! must_be_general_cursor { ($cursor_id:expr, $cursor_ref:expr, $cursors:expr, $insn_name:expr) => {{ let (_, cursor_type) = $cursor_ref.get($cursor_id).unwrap(); let cursor = match cursor_type { @@ -519,7 +519,7 @@ impl Program { state.pc += 1; } Insn::NullRow { cursor_id } => { - match must_be_btree_cursor!(*cursor_id, self.cursor_ref, cursors, "NullRow") { + match must_be_general_cursor!(*cursor_id, self.cursor_ref, cursors, "NullRow") { GeneralCursor::BTree(cursor) => cursor.set_null_flag(true), GeneralCursor::Ephemeral(cursor) => cursor.set_null_flag(true), } @@ -875,7 +875,7 @@ impl Program { state.pc += 1; } Insn::RewindAsync { cursor_id } => { - match must_be_btree_cursor!(*cursor_id, self.cursor_ref, cursors, "RewindAsync") + match must_be_general_cursor!(*cursor_id, self.cursor_ref, cursors, "RewindAsync") { GeneralCursor::BTree(cursor) => return_if_io!(cursor.rewind()), GeneralCursor::Ephemeral(cursor) => return_if_io!(cursor.rewind()), @@ -884,7 +884,7 @@ impl Program { state.pc += 1; } Insn::LastAsync { cursor_id } => { - match must_be_btree_cursor!(*cursor_id, self.cursor_ref, cursors, "LastAsync") { + match must_be_general_cursor!(*cursor_id, self.cursor_ref, cursors, "LastAsync") { GeneralCursor::BTree(cursor) => return_if_io!(cursor.last()), GeneralCursor::Ephemeral(cursor) => return_if_io!(cursor.last()), } @@ -896,7 +896,7 @@ impl Program { } => { assert!(pc_if_empty.is_offset()); - match must_be_btree_cursor!(*cursor_id, self.cursor_ref, cursors, "LastAwait") { + match must_be_general_cursor!(*cursor_id, self.cursor_ref, cursors, "LastAwait") { GeneralCursor::BTree(cursor) => { cursor.wait_for_completion()?; if cursor.is_empty() { @@ -921,7 +921,7 @@ impl Program { } => { assert!(pc_if_empty.is_offset()); - match must_be_btree_cursor!(*cursor_id, self.cursor_ref, cursors, "RewindAwait") + match must_be_general_cursor!(*cursor_id, self.cursor_ref, cursors, "RewindAwait") { GeneralCursor::BTree(cursor) => { cursor.wait_for_completion()?; @@ -963,7 +963,7 @@ impl Program { CursorType::BTreeTable(_) | CursorType::BTreeIndex(_) | CursorType::Ephemeral(_) => { - match must_be_btree_cursor!( + match must_be_general_cursor!( *cursor_id, self.cursor_ref, cursors, @@ -1029,7 +1029,7 @@ impl Program { return Ok(StepResult::Row(record)); } Insn::NextAsync { cursor_id } => { - match must_be_btree_cursor!(*cursor_id, self.cursor_ref, cursors, "NextAsync") { + match must_be_general_cursor!(*cursor_id, self.cursor_ref, cursors, "NextAsync") { GeneralCursor::BTree(cursor) => { cursor.set_null_flag(false); return_if_io!(cursor.next()); @@ -1043,7 +1043,7 @@ impl Program { state.pc += 1; } Insn::PrevAsync { cursor_id } => { - match must_be_btree_cursor!(*cursor_id, self.cursor_ref, cursors, "PrevAsync") { + match must_be_general_cursor!(*cursor_id, self.cursor_ref, cursors, "PrevAsync") { GeneralCursor::BTree(cursor) => { cursor.set_null_flag(false); return_if_io!(cursor.prev()); @@ -1062,7 +1062,7 @@ impl Program { } => { assert!(pc_if_next.is_offset()); - match must_be_btree_cursor!(*cursor_id, self.cursor_ref, cursors, "PrevAwait") { + match must_be_general_cursor!(*cursor_id, self.cursor_ref, cursors, "PrevAwait") { GeneralCursor::BTree(cursor) => { cursor.wait_for_completion()?; if !cursor.is_empty() { @@ -1087,7 +1087,7 @@ impl Program { } => { assert!(pc_if_next.is_offset()); - match must_be_btree_cursor!(*cursor_id, self.cursor_ref, cursors, "NextAwait") { + match must_be_general_cursor!(*cursor_id, self.cursor_ref, cursors, "NextAwait") { GeneralCursor::BTree(cursor) => { cursor.wait_for_completion()?; if !cursor.is_empty() { @@ -2421,7 +2421,7 @@ impl Program { cursor, rowid_reg, target_pc, - } => match must_be_btree_cursor!(*cursor, self.cursor_ref, cursors, "NotExists") { + } => match must_be_general_cursor!(*cursor, self.cursor_ref, cursors, "NotExists") { GeneralCursor::BTree(cursor) => { let exists = return_if_io!(cursor.exists(&state.registers[*rowid_reg])); if exists {