Skip to content

Commit fa09b7c

Browse files
committed
1 parent 5ac7795 commit fa09b7c

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/binder/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ impl<'a, T: Transaction> Binder<'a, '_, T> {
342342
try_default!(&full_name.0, full_name.1);
343343
}
344344
if let Some(table) = full_name.0.or(bind_table_name) {
345-
let source = self.context.bind_source(&table, self.parent)?;
345+
let source = self.context.bind_source(&table)?;
346346
let schema_buf = self.table_schema_buf.entry(Arc::new(table)).or_default();
347347

348348
Ok(ScalarExpression::ColumnRef(

src/binder/mod.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -272,18 +272,12 @@ impl<'a, T: Transaction> BinderContext<'a, T> {
272272
Ok(source)
273273
}
274274

275-
pub fn bind_source<'b: 'a>(
276-
&self,
277-
table_name: &str,
278-
parent: Option<&'b Binder<'a, 'b, T>>,
279-
) -> Result<&Source, DatabaseError> {
275+
pub fn bind_source<'b: 'a>(&self, table_name: &str) -> Result<&Source, DatabaseError> {
280276
if let Some(source) = self.bind_table.iter().find(|((t, alias, _), _)| {
281277
t.as_str() == table_name
282278
|| matches!(alias.as_ref().map(|a| a.as_str() == table_name), Some(true))
283279
}) {
284280
Ok(source.1)
285-
} else if let Some(binder) = parent {
286-
binder.context.bind_source(table_name, binder.parent)
287281
} else {
288282
Err(DatabaseError::InvalidTable(table_name.into()))
289283
}

0 commit comments

Comments
 (0)