File tree Expand file tree Collapse file tree 6 files changed +14
-14
lines changed Expand file tree Collapse file tree 6 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -783,7 +783,7 @@ pub enum Statement {
783
783
partition_action : Option < AddDropSync > ,
784
784
} ,
785
785
/// SELECT
786
- Query ( Box < Query > ) ,
786
+ Query ( Query ) ,
787
787
/// INSERT
788
788
Insert {
789
789
/// Only for Sqlite
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ pub enum SetExpr {
74
74
Select ( Box < Select > ) ,
75
75
/// Parenthesized SELECT subquery, which may include more set operations
76
76
/// in its body and an optional ORDER BY / LIMIT.
77
- Query ( Box < Query > ) ,
77
+ Query ( Query ) ,
78
78
/// UNION/EXCEPT/INTERSECT of two queries
79
79
SetOperation {
80
80
op : SetOperator ,
Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ impl<'a> Parser<'a> {
160
160
Keyword :: ANALYZE => Ok ( self . parse_analyze ( ) ?) ,
161
161
Keyword :: SELECT | Keyword :: WITH | Keyword :: VALUES => {
162
162
self . prev_token ( ) ;
163
- Ok ( Statement :: Query ( Box :: new ( self . parse_query ( ) ?) ) )
163
+ Ok ( Statement :: Query ( self . parse_query ( ) ?) )
164
164
}
165
165
Keyword :: TRUNCATE => Ok ( self . parse_truncate ( ) ?) ,
166
166
Keyword :: MSCK => Ok ( self . parse_msck ( ) ?) ,
@@ -205,7 +205,7 @@ impl<'a> Parser<'a> {
205
205
} ,
206
206
Token :: LParen => {
207
207
self . prev_token ( ) ;
208
- Ok ( Statement :: Query ( Box :: new ( self . parse_query ( ) ?) ) )
208
+ Ok ( Statement :: Query ( self . parse_query ( ) ?) )
209
209
}
210
210
unexpected => self . expected ( "an SQL statement" , unexpected) ,
211
211
}
@@ -3429,7 +3429,7 @@ impl<'a> Parser<'a> {
3429
3429
// CTEs are not allowed here, but the parser currently accepts them
3430
3430
let subquery = self . parse_query ( ) ?;
3431
3431
self . expect_token ( & Token :: RParen ) ?;
3432
- SetExpr :: Query ( Box :: new ( subquery) )
3432
+ SetExpr :: Query ( subquery)
3433
3433
} else if self . parse_keyword ( Keyword :: VALUES ) {
3434
3434
SetExpr :: Values ( self . parse_values ( ) ?)
3435
3435
} else {
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ impl TestedDialects {
107
107
/// after a serialization round-trip.
108
108
pub fn verified_query ( & self , sql : & str ) -> Query {
109
109
match self . verified_stmt ( sql) {
110
- Statement :: Query ( query) => * query,
110
+ Statement :: Query ( query) => query,
111
111
_ => panic ! ( "Expected Query" ) ,
112
112
}
113
113
}
Original file line number Diff line number Diff line change @@ -312,7 +312,7 @@ fn parse_quote_identifiers_2() {
312
312
let sql = "SELECT `quoted `` identifier`" ;
313
313
assert_eq ! (
314
314
mysql( ) . verified_stmt( sql) ,
315
- Statement :: Query ( Box :: new ( Query {
315
+ Statement :: Query ( Query {
316
316
with: None ,
317
317
body: Box :: new( SetExpr :: Select ( Box :: new( Select {
318
318
distinct: false ,
@@ -337,7 +337,7 @@ fn parse_quote_identifiers_2() {
337
337
offset: None ,
338
338
fetch: None ,
339
339
lock: None ,
340
- } ) )
340
+ } )
341
341
) ;
342
342
}
343
343
@@ -346,7 +346,7 @@ fn parse_quote_identifiers_3() {
346
346
let sql = "SELECT ```quoted identifier```" ;
347
347
assert_eq ! (
348
348
mysql( ) . verified_stmt( sql) ,
349
- Statement :: Query ( Box :: new ( Query {
349
+ Statement :: Query ( Query {
350
350
with: None ,
351
351
body: Box :: new( SetExpr :: Select ( Box :: new( Select {
352
352
distinct: false ,
@@ -371,7 +371,7 @@ fn parse_quote_identifiers_3() {
371
371
offset: None ,
372
372
fetch: None ,
373
373
lock: None ,
374
- } ) )
374
+ } )
375
375
) ;
376
376
}
377
377
@@ -766,7 +766,7 @@ fn parse_substring_in_select() {
766
766
) {
767
767
Statement :: Query ( query) => {
768
768
assert_eq ! (
769
- Box :: new ( Query {
769
+ Query {
770
770
with: None ,
771
771
body: Box :: new( SetExpr :: Select ( Box :: new( Select {
772
772
distinct: true ,
@@ -812,7 +812,7 @@ fn parse_substring_in_select() {
812
812
offset: None ,
813
813
fetch: None ,
814
814
lock: None ,
815
- } ) ,
815
+ } ,
816
816
query
817
817
) ;
818
818
}
Original file line number Diff line number Diff line change @@ -1068,9 +1068,9 @@ fn parse_prepare() {
1068
1068
} ;
1069
1069
assert_eq ! (
1070
1070
sub_stmt,
1071
- Box :: new( Statement :: Query ( Box :: new ( pg_and_generic( ) . verified_query(
1071
+ Box :: new( Statement :: Query ( pg_and_generic( ) . verified_query(
1072
1072
"SELECT * FROM customers WHERE customers.id = a1"
1073
- ) ) ) )
1073
+ ) ) )
1074
1074
) ;
1075
1075
}
1076
1076
You can’t perform that action at this time.
0 commit comments