@@ -25,23 +25,23 @@ use crate::tokenizer::Span;
2525
2626use super :: {
2727 dcl:: SecondaryRoles , value:: ValueWithSpan , AccessExpr , AlterColumnOperation ,
28- AlterIndexOperation , AlterTableOperation , Array , Assignment , AssignmentTarget , AttachedToken ,
29- BeginEndStatements , CaseStatement , CloseCursor , ClusteredIndex , ColumnDef , ColumnOption ,
30- ColumnOptionDef , ConditionalStatementBlock , ConditionalStatements , ConflictTarget , ConnectBy ,
31- ConstraintCharacteristics , CopySource , CreateIndex , CreateTable , CreateTableOptions , Cte ,
32- Delete , DoUpdate , ExceptSelectItem , ExcludeSelectItem , Expr , ExprWithAlias , Fetch , FromTable ,
33- Function , FunctionArg , FunctionArgExpr , FunctionArgumentClause , FunctionArgumentList ,
34- FunctionArguments , GroupByExpr , HavingBound , IfStatement , IlikeSelectItem , IndexColumn , Insert ,
35- Interpolate , InterpolateExpr , Join , JoinConstraint , JoinOperator , JsonPath , JsonPathElem ,
36- LateralView , LimitClause , MatchRecognizePattern , Measure , NamedParenthesizedList ,
37- NamedWindowDefinition , ObjectName , ObjectNamePart , Offset , OnConflict , OnConflictAction ,
38- OnInsert , OpenStatement , OrderBy , OrderByExpr , OrderByKind , Partition , PivotValueSource ,
39- ProjectionSelect , Query , RaiseStatement , RaiseStatementValue , ReferentialAction ,
40- RenameSelectItem , ReplaceSelectElement , ReplaceSelectItem , Select , SelectInto , SelectItem ,
41- SetExpr , SqlOption , Statement , Subscript , SymbolDefinition , TableAlias , TableAliasColumnDef ,
42- TableConstraint , TableFactor , TableObject , TableOptionsClustered , TableWithJoins ,
43- UpdateTableFromKind , Use , Value , Values , ViewColumnDef , WhileStatement ,
44- WildcardAdditionalOptions , With , WithFill ,
28+ AlterIndexOperation , AlterTableOperation , Analyze , Array , Assignment , AssignmentTarget ,
29+ AttachedToken , BeginEndStatements , CaseStatement , CloseCursor , ClusteredIndex , ColumnDef ,
30+ ColumnOption , ColumnOptionDef , ConditionalStatementBlock , ConditionalStatements ,
31+ ConflictTarget , ConnectBy , ConstraintCharacteristics , CopySource , CreateIndex , CreateTable ,
32+ CreateTableOptions , Cte , Delete , DoUpdate , ExceptSelectItem , ExcludeSelectItem , Expr ,
33+ ExprWithAlias , Fetch , FromTable , Function , FunctionArg , FunctionArgExpr ,
34+ FunctionArgumentClause , FunctionArgumentList , FunctionArguments , GroupByExpr , HavingBound ,
35+ IfStatement , IlikeSelectItem , IndexColumn , Insert , Interpolate , InterpolateExpr , Join ,
36+ JoinConstraint , JoinOperator , JsonPath , JsonPathElem , LateralView , LimitClause ,
37+ MatchRecognizePattern , Measure , NamedParenthesizedList , NamedWindowDefinition , ObjectName ,
38+ ObjectNamePart , Offset , OnConflict , OnConflictAction , OnInsert , OpenStatement , OrderBy ,
39+ OrderByExpr , OrderByKind , Partition , PivotValueSource , ProjectionSelect , Query , RaiseStatement ,
40+ RaiseStatementValue , ReferentialAction , RenameSelectItem , ReplaceSelectElement ,
41+ ReplaceSelectItem , Select , SelectInto , SelectItem , SetExpr , SqlOption , Statement , Subscript ,
42+ SymbolDefinition , TableAlias , TableAliasColumnDef , TableConstraint , TableFactor , TableObject ,
43+ TableOptionsClustered , TableWithJoins , UpdateTableFromKind , Use , Value , Values , ViewColumnDef ,
44+ WhileStatement , WildcardAdditionalOptions , With , WithFill ,
4545} ;
4646
4747/// Given an iterator of spans, return the [Span::union] of all spans.
@@ -298,20 +298,7 @@ impl Spanned for Values {
298298impl Spanned for Statement {
299299 fn span ( & self ) -> Span {
300300 match self {
301- Statement :: Analyze {
302- table_name,
303- partitions,
304- for_columns : _,
305- columns,
306- cache_metadata : _,
307- noscan : _,
308- compute_statistics : _,
309- has_table_keyword : _,
310- } => union_spans (
311- core:: iter:: once ( table_name. span ( ) )
312- . chain ( partitions. iter ( ) . flat_map ( |i| i. iter ( ) . map ( |k| k. span ( ) ) ) )
313- . chain ( columns. iter ( ) . map ( |i| i. span ) ) ,
314- ) ,
301+ Statement :: Analyze ( analyze) => analyze. span ( ) ,
315302 Statement :: Truncate {
316303 table_names,
317304 partitions,
@@ -944,6 +931,20 @@ impl Spanned for ConstraintCharacteristics {
944931 }
945932}
946933
934+ impl Spanned for Analyze {
935+ fn span ( & self ) -> Span {
936+ union_spans (
937+ core:: iter:: once ( self . table_name . span ( ) )
938+ . chain (
939+ self . partitions
940+ . iter ( )
941+ . flat_map ( |i| i. iter ( ) . map ( |k| k. span ( ) ) ) ,
942+ )
943+ . chain ( self . columns . iter ( ) . map ( |i| i. span ) ) ,
944+ )
945+ }
946+ }
947+
947948/// # partial span
948949///
949950/// Missing spans:
0 commit comments