Use schema.get_table(...) instead of referencing directly

This commit is contained in:
김선우
2024-12-23 04:54:40 +09:00
parent 82c127b7a3
commit f8d4edc8d7

View File

@@ -489,17 +489,15 @@ pub fn prepare_delete_plan(
tbl_name: &QualifiedName,
where_clause: Option<Expr>,
) -> Result<Plan> {
let table_name = tbl_name.name.0.clone();
let table = if let Some(table) = schema.get_table(&table_name) {
table
} else {
crate::bail_parse_error!("Table {} not found", table_name);
// let table_name = tbl_name.name.0.clone();
let table = match schema.get_table(tbl_name.name.0.as_str()) {
Some(table) => table,
None => crate::bail_corrupt_error!("Parse error: no such table: {}", tbl_name),
};
let table_ref = BTreeTableReference {
table: table.clone(),
table_identifier: table_name.clone(),
table_identifier: table.name.clone(),
table_index: 0,
};