Skip to content

Commit 05bf229

Browse files
MazterQyoumcheshkov
authored andcommitted
chore: Box Query in Cte
Can drop this after rebase on commit 0724ef1 "Box Query in Cte (apache#572)", first released in 0.24.0
1 parent 73b3c3a commit 05bf229

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/ast/query.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ impl fmt::Display for With {
271271
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
272272
pub struct Cte {
273273
pub alias: TableAlias,
274-
pub query: Query,
274+
pub query: Box<Query>,
275275
pub from: Option<Ident>,
276276
}
277277

src/parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3309,7 +3309,7 @@ impl<'a> Parser<'a> {
33093309

33103310
let mut cte = if self.parse_keyword(Keyword::AS) {
33113311
self.expect_token(&Token::LParen)?;
3312-
let query = self.parse_query()?;
3312+
let query = Box::new(self.parse_query()?);
33133313
self.expect_token(&Token::RParen)?;
33143314
let alias = TableAlias {
33153315
name,
@@ -3324,7 +3324,7 @@ impl<'a> Parser<'a> {
33243324
let columns = self.parse_parenthesized_column_list(Optional)?;
33253325
self.expect_keyword(Keyword::AS)?;
33263326
self.expect_token(&Token::LParen)?;
3327-
let query = self.parse_query()?;
3327+
let query = Box::new(self.parse_query()?);
33283328
self.expect_token(&Token::RParen)?;
33293329
let alias = TableAlias { name, columns };
33303330
Cte {

tests/sqlparser_common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3479,7 +3479,7 @@ fn parse_recursive_cte() {
34793479
quote_style: None,
34803480
}],
34813481
},
3482-
query: cte_query,
3482+
query: Box::new(cte_query),
34833483
from: None,
34843484
};
34853485
assert_eq!(with.cte_tables.first().unwrap(), &expected);

0 commit comments

Comments
 (0)