Skip to content

Commit

Permalink
Update macro name to
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoreis42 committed Jan 31, 2025
1 parent ed66132 commit 8cd2e82
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions core/vdbe/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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),
}
Expand Down Expand Up @@ -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()),
Expand All @@ -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()),
}
Expand All @@ -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() {
Expand All @@ -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()?;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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());
Expand All @@ -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());
Expand All @@ -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() {
Expand All @@ -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() {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 8cd2e82

Please sign in to comment.