mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-09-03 04:37:21 +00:00
Box Query
in Cte
(#572)
This commit is contained in:
parent
39761b0599
commit
0724ef13a4
3 changed files with 4 additions and 4 deletions
|
@ -271,7 +271,7 @@ impl fmt::Display for With {
|
||||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||||
pub struct Cte {
|
pub struct Cte {
|
||||||
pub alias: TableAlias,
|
pub alias: TableAlias,
|
||||||
pub query: Query,
|
pub query: Box<Query>,
|
||||||
pub from: Option<Ident>,
|
pub from: Option<Ident>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3550,7 +3550,7 @@ impl<'a> Parser<'a> {
|
||||||
|
|
||||||
let mut cte = if self.parse_keyword(Keyword::AS) {
|
let mut cte = if self.parse_keyword(Keyword::AS) {
|
||||||
self.expect_token(&Token::LParen)?;
|
self.expect_token(&Token::LParen)?;
|
||||||
let query = self.parse_query()?;
|
let query = Box::new(self.parse_query()?);
|
||||||
self.expect_token(&Token::RParen)?;
|
self.expect_token(&Token::RParen)?;
|
||||||
let alias = TableAlias {
|
let alias = TableAlias {
|
||||||
name,
|
name,
|
||||||
|
@ -3565,7 +3565,7 @@ impl<'a> Parser<'a> {
|
||||||
let columns = self.parse_parenthesized_column_list(Optional)?;
|
let columns = self.parse_parenthesized_column_list(Optional)?;
|
||||||
self.expect_keyword(Keyword::AS)?;
|
self.expect_keyword(Keyword::AS)?;
|
||||||
self.expect_token(&Token::LParen)?;
|
self.expect_token(&Token::LParen)?;
|
||||||
let query = self.parse_query()?;
|
let query = Box::new(self.parse_query()?);
|
||||||
self.expect_token(&Token::RParen)?;
|
self.expect_token(&Token::RParen)?;
|
||||||
let alias = TableAlias { name, columns };
|
let alias = TableAlias { name, columns };
|
||||||
Cte {
|
Cte {
|
||||||
|
|
|
@ -3861,7 +3861,7 @@ fn parse_recursive_cte() {
|
||||||
quote_style: None,
|
quote_style: None,
|
||||||
}],
|
}],
|
||||||
},
|
},
|
||||||
query: cte_query,
|
query: Box::new(cte_query),
|
||||||
from: None,
|
from: None,
|
||||||
};
|
};
|
||||||
assert_eq!(with.cte_tables.first().unwrap(), &expected);
|
assert_eq!(with.cte_tables.first().unwrap(), &expected);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue