File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -711,7 +711,7 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
711711 . iter ( )
712712 . filter_map ( |p| p. as_ident ( ) )
713713 . map ( |id| self . ident_normalizer . normalize ( id. clone ( ) ) )
714- . last ( ) ?;
714+ . next_back ( ) ?;
715715 Some ( ( table_name, span) )
716716 }
717717 _ => None ,
@@ -745,17 +745,16 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
745745 let right = self . plan_table_with_joins ( input, planner_context) ?;
746746
747747 left = left. cross_join ( right) . map_err ( |e| {
748- if let Some ( ( ref name, ref current_span) ) = current_name {
749- if let Some ( prior_span) =
748+ if let Some ( ( ref name, ref current_span) ) = current_name
749+ && let Some ( prior_span) =
750750 alias_spans. get ( name) . copied ( ) . flatten ( )
751- {
752- let diagnostic = Diagnostic :: new_error (
753- "duplicate table alias in FROM clause" ,
754- * current_span,
755- )
756- . with_note ( "first defined here" , Some ( prior_span) ) ;
757- return e. with_diagnostic ( diagnostic) ;
758- }
751+ {
752+ let diagnostic = Diagnostic :: new_error (
753+ "duplicate table alias in FROM clause" ,
754+ * current_span,
755+ )
756+ . with_note ( "first defined here" , Some ( prior_span) ) ;
757+ return e. with_diagnostic ( diagnostic) ;
759758 }
760759 e
761760 } ) ?;
You can’t perform that action at this time.
0 commit comments