@@ -108,7 +108,14 @@ fn calc_inline_constraints_from_columns(columns: &[ColumnDef]) -> Vec<TableConst
108108 for ast:: ColumnOptionDef { name, option } in & column. options {
109109 match option {
110110 ast:: ColumnOption :: Unique ( UniqueConstraint {
111- characteristics, ..
111+ characteristics,
112+ name,
113+ index_name : _index_name,
114+ index_type_display : _index_type_display,
115+ index_type : _index_type,
116+ columns : _column,
117+ index_options : _index_options,
118+ nulls_distinct : _nulls_distinct,
112119 } ) => constraints. push ( TableConstraint :: Unique ( UniqueConstraint {
113120 name : name. clone ( ) ,
114121 index_name : None ,
@@ -131,7 +138,11 @@ fn calc_inline_constraints_from_columns(columns: &[ColumnDef]) -> Vec<TableConst
131138 } ) ) ,
132139 ast:: ColumnOption :: PrimaryKey ( PrimaryKeyConstraint {
133140 characteristics,
134- ..
141+ name : _name,
142+ index_name : _index_name,
143+ index_type : _index_type,
144+ columns : _columns,
145+ index_options : _index_options,
135146 } ) => {
136147 constraints. push ( TableConstraint :: PrimaryKey ( PrimaryKeyConstraint {
137148 name : name. clone ( ) ,
@@ -158,27 +169,32 @@ fn calc_inline_constraints_from_columns(columns: &[ColumnDef]) -> Vec<TableConst
158169 on_delete,
159170 on_update,
160171 characteristics,
161- ..
172+ name : _name,
173+ index_name : _index_name,
174+ columns : _columns,
175+ match_kind : _match_kind,
162176 } ) => {
163177 constraints. push ( TableConstraint :: ForeignKey ( ForeignKeyConstraint {
164178 name : name. clone ( ) ,
165179 index_name : None ,
166180 columns : vec ! [ ] ,
167181 foreign_table : foreign_table. clone ( ) ,
168182 referred_columns : referred_columns. clone ( ) ,
169- on_delete : on_delete. clone ( ) ,
170- on_update : on_update. clone ( ) ,
183+ on_delete : * on_delete,
184+ on_update : * on_update,
171185 match_kind : None ,
172186 characteristics : * characteristics,
173187 } ) )
174188 }
175- ast:: ColumnOption :: Check ( CheckConstraint { name, expr, .. } ) => {
176- constraints. push ( TableConstraint :: Check ( CheckConstraint {
177- name : name. clone ( ) ,
178- expr : expr. clone ( ) ,
179- enforced : None ,
180- } ) )
181- }
189+ ast:: ColumnOption :: Check ( CheckConstraint {
190+ name,
191+ expr,
192+ enforced : _enforced,
193+ } ) => constraints. push ( TableConstraint :: Check ( CheckConstraint {
194+ name : name. clone ( ) ,
195+ expr : expr. clone ( ) ,
196+ enforced : None ,
197+ } ) ) ,
182198 ast:: ColumnOption :: Default ( _)
183199 | ast:: ColumnOption :: Null
184200 | ast:: ColumnOption :: NotNull
@@ -1042,7 +1058,7 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
10421058 returning,
10431059 or,
10441060 limit,
1045- ..
1061+ update_token : _ ,
10461062 } ) => {
10471063 let from_clauses =
10481064 from. map ( |update_table_from_kind| match update_table_from_kind {
@@ -1074,7 +1090,7 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
10741090 from,
10751091 order_by,
10761092 limit,
1077- ..
1093+ delete_token : _ ,
10781094 } ) => {
10791095 if !tables. is_empty ( ) {
10801096 plan_err ! ( "DELETE <TABLE> not supported" ) ?;
@@ -1350,18 +1366,22 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
13501366
13511367 Ok ( LogicalPlan :: Ddl ( statement) )
13521368 }
1353- Statement :: DropFunction ( func) => {
1369+ Statement :: DropFunction ( ast:: DropFunction {
1370+ if_exists,
1371+ func_desc,
1372+ drop_behavior : _,
1373+ } ) => {
13541374 // According to postgresql documentation it can be only one function
13551375 // specified in drop statement
1356- if let Some ( desc) = func . func_desc . first ( ) {
1376+ if let Some ( desc) = func_desc. first ( ) {
13571377 // At the moment functions can't be qualified `schema.name`
13581378 let name = match & desc. name . 0 [ ..] {
13591379 [ ] => exec_err ! ( "Function should have name" ) ?,
13601380 [ n] => n. as_ident ( ) . unwrap ( ) . value . clone ( ) ,
13611381 [ ..] => not_impl_err ! ( "Qualified functions are not supported" ) ?,
13621382 } ;
13631383 let statement = DdlStatement :: DropFunction ( DropFunction {
1364- if_exists : func . if_exists ,
1384+ if_exists,
13651385 name,
13661386 schema : DFSchemaRef :: new ( DFSchema :: empty ( ) ) ,
13671387 } ) ;
@@ -1724,24 +1744,40 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
17241744 let constraints = constraints
17251745 . iter ( )
17261746 . map ( |c : & TableConstraint | match c {
1727- TableConstraint :: Unique ( constraint) => {
1728- let constraint_name = match & constraint. name {
1747+ TableConstraint :: Unique ( UniqueConstraint {
1748+ name,
1749+ index_name : _,
1750+ index_type_display : _,
1751+ index_type : _,
1752+ columns,
1753+ index_options : _,
1754+ characteristics : _,
1755+ nulls_distinct : _,
1756+ } ) => {
1757+ let constraint_name = match & name {
17291758 Some ( name) => & format ! ( "unique constraint with name '{name}'" ) ,
17301759 None => "unique constraint" ,
17311760 } ;
17321761 // Get unique constraint indices in the schema
17331762 let indices = self . get_constraint_column_indices (
17341763 df_schema,
1735- & constraint . columns ,
1764+ & columns,
17361765 constraint_name,
17371766 ) ?;
17381767 Ok ( Constraint :: Unique ( indices) )
17391768 }
1740- TableConstraint :: PrimaryKey ( constraint) => {
1769+ TableConstraint :: PrimaryKey ( PrimaryKeyConstraint {
1770+ name : _,
1771+ index_name : _,
1772+ index_type : _,
1773+ columns,
1774+ index_options : _,
1775+ characteristics : _,
1776+ } ) => {
17411777 // Get primary key indices in the schema
17421778 let indices = self . get_constraint_column_indices (
17431779 df_schema,
1744- & constraint . columns ,
1780+ & columns,
17451781 "primary key" ,
17461782 ) ?;
17471783 Ok ( Constraint :: PrimaryKey ( indices) )
0 commit comments