translate: updated the command to more closely match SQLite semantics

the command for drop table translation has been updated so that it more closely matches the semantics of SQLite's drop table command.

there are a few more things missing like ephemeral tables, destroy etc.
This commit is contained in:
Zaid Humayun
2025-02-06 22:56:06 +05:30
parent 76e2d98381
commit b8bebf3fa3
4 changed files with 36 additions and 27 deletions

View File

@@ -1101,8 +1101,8 @@ pub fn insn_to_str(
0,
format!("r[{}]=root iDb={} flags={}", root, db, flags),
),
Insn::DropBtree { db, root } => (
"DropBtree",
Insn::DropTable { db, root } => (
"DropTable",
*db as i32,
*root as i32,
0,

View File

@@ -590,8 +590,8 @@ pub enum Insn {
flags: usize,
},
// Drop a b-tree
DropBtree {
// Drop a table
DropTable {
// The database within which this b-tree needs to be dropped (P1).
db: usize,
// The root page of this b-tree (P2).

View File

@@ -2688,7 +2688,7 @@ impl Program {
state.registers[*root] = OwnedValue::Integer(root_page as i64);
state.pc += 1;
}
Insn::DropBtree { db, root } => {
Insn::DropTable { db, root } => {
if *db > 0 {
todo!("temp databases not implemented yet");
}