mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-09 19:24:21 +01:00
Don't crash if DELETE uses index
This commit is contained in:
@@ -143,9 +143,24 @@ impl Display for DeletePlan {
|
||||
|
||||
writeln!(f, "{indent}DELETE FROM {table_name}")?;
|
||||
}
|
||||
Operation::Search { .. } => {
|
||||
panic!("DELETE plans should not contain search operations");
|
||||
}
|
||||
Operation::Search(search) => match search {
|
||||
Search::RowidEq { .. } | Search::Seek { index: None, .. } => {
|
||||
writeln!(
|
||||
f,
|
||||
"{}SEARCH {} USING INTEGER PRIMARY KEY (rowid=?)",
|
||||
indent, reference.identifier
|
||||
)?;
|
||||
}
|
||||
Search::Seek {
|
||||
index: Some(index), ..
|
||||
} => {
|
||||
writeln!(
|
||||
f,
|
||||
"{}SEARCH {} USING INDEX {}",
|
||||
indent, reference.identifier, index.name
|
||||
)?;
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user