From d6972a9cf36c841e241b250cbf4b604907276c4a Mon Sep 17 00:00:00 2001 From: Nikita Sivukhin Date: Mon, 27 Oct 2025 18:22:35 +0400 Subject: [PATCH] fix explain --- core/vdbe/explain.rs | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/core/vdbe/explain.rs b/core/vdbe/explain.rs index 4f09e2ea0..ccaca542d 100644 --- a/core/vdbe/explain.rs +++ b/core/vdbe/explain.rs @@ -19,11 +19,12 @@ pub fn insn_to_row( let get_table_or_index_name = |cursor_id: usize| { let cursor_type = &program.cursor_ref[cursor_id].1; match cursor_type { - CursorType::BTreeTable(table) => &table.name, - CursorType::BTreeIndex(index) => &index.name, + CursorType::BTreeTable(table) => table.name.as_str(), + CursorType::BTreeIndex(index) => index.name.as_str(), + CursorType::IndexMethod(descriptor) => descriptor.definition().index_name, CursorType::Pseudo(_) => "pseudo", - CursorType::VirtualTable(virtual_table) => &virtual_table.name, - CursorType::MaterializedView(table, _) => &table.name, + CursorType::VirtualTable(virtual_table) => virtual_table.name.as_str(), + CursorType::MaterializedView(table, _) => table.name.as_str(), CursorType::Sorter => "sorter", } }; @@ -551,6 +552,7 @@ pub fn insn_to_row( } CursorType::Pseudo(_) => None, CursorType::Sorter => None, + CursorType::IndexMethod(..) => None, CursorType::VirtualTable(v) => v.columns.get(*column).unwrap().name.as_ref(), }; ( @@ -1283,6 +1285,33 @@ pub fn insn_to_row( 0, format!("r[{}]=root iDb={} flags={}", root, db, flags.get_flags()), ), + Insn::IndexMethodCreate { db, cursor_id } => ( + "IndexMethodCreate", + *db as i32, + *cursor_id as i32, + 0, + Value::build_text(""), + 0, + "".to_string() + ), + Insn::IndexMethodDestroy { db, cursor_id } => ( + "IndexMethodDestroy", + *db as i32, + *cursor_id as i32, + 0, + Value::build_text(""), + 0, + "".to_string() + ), + Insn::IndexMethodQuery { db, cursor_id, start_reg, .. } => ( + "IndexMethodQuery", + *db as i32, + *cursor_id as i32, + *start_reg as i32, + Value::build_text(""), + 0, + "".to_string() + ), Insn::Destroy { root, former_root_reg,