Skip to content

Commit bcee283

Browse files
committed
chore: codefmt
1 parent 40b877f commit bcee283

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/binder/select.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ impl<'a: 'b, 'b, T: Transaction, A: AsRef<[(&'static str, DataValue)]>> Binder<'
198198
rows.push(row);
199199
}
200200

201+
let value_name = self.context.temp_table();
201202
let column_refs: Vec<ColumnRef> = inferred_types
202203
.into_iter()
203204
.enumerate()
@@ -208,7 +209,7 @@ impl<'a: 'b, 'b, T: Transaction, A: AsRef<[(&'static str, DataValue)]>> Binder<'
208209
false,
209210
ColumnDesc::new(typ, None, false, None)?,
210211
);
211-
column_ref.set_ref_table(self.context.temp_table(), ColumnId::default(), true);
212+
column_ref.set_ref_table(value_name.clone(), ColumnId::default(), true);
212213
Ok(ColumnRef(Arc::new(column_ref)))
213214
})
214215
.collect::<Result<_, DatabaseError>>()?;
@@ -416,13 +417,9 @@ impl<'a: 'b, 'b, T: Transaction, A: AsRef<[(&'static str, DataValue)]>> Binder<'
416417
));
417418
}
418419
let table_alias = Arc::new(name.value.to_lowercase());
420+
let table = tables.pop().unwrap_or_else(|| self.context.temp_table());
419421

420-
plan = self.bind_alias(
421-
plan,
422-
alias_column,
423-
table_alias,
424-
tables.pop().unwrap_or(Arc::new("_temp_table_".to_string())),
425-
)?;
422+
plan = self.bind_alias(plan, alias_column, table_alias, table)?;
426423
}
427424
plan
428425
}

src/planner/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ impl LogicalPlan {
115115
fn collect_table(plan: &LogicalPlan, results: &mut Vec<TableName>) {
116116
if let Operator::TableScan(op) = &plan.operator {
117117
results.push(op.table_name.clone());
118-
} else if let Operator::Values(op) = &plan.operator {
119-
results.push(op.schema_ref[0].table_name().unwrap().clone());
120118
}
121119
for child in plan.childrens.iter() {
122120
collect_table(child, results);

0 commit comments

Comments
 (0)