mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-09 21:42:05 +00:00
Add support for parenthesized subquery as IN
predicate (#1793)
This commit is contained in:
parent
514d2ecdaf
commit
3ad13af563
3 changed files with 22 additions and 10 deletions
|
@ -3756,15 +3756,13 @@ impl<'a> Parser<'a> {
|
|||
});
|
||||
}
|
||||
self.expect_token(&Token::LParen)?;
|
||||
let in_op = if self.parse_keyword(Keyword::SELECT) || self.parse_keyword(Keyword::WITH) {
|
||||
self.prev_token();
|
||||
Expr::InSubquery {
|
||||
let in_op = match self.maybe_parse(|p| p.parse_query_body(p.dialect.prec_unknown()))? {
|
||||
Some(subquery) => Expr::InSubquery {
|
||||
expr: Box::new(expr),
|
||||
subquery: self.parse_query()?,
|
||||
subquery,
|
||||
negated,
|
||||
}
|
||||
} else {
|
||||
Expr::InList {
|
||||
},
|
||||
None => Expr::InList {
|
||||
expr: Box::new(expr),
|
||||
list: if self.dialect.supports_in_empty_list() {
|
||||
self.parse_comma_separated0(Parser::parse_expr, Token::RParen)?
|
||||
|
@ -3772,7 +3770,7 @@ impl<'a> Parser<'a> {
|
|||
self.parse_comma_separated(Parser::parse_expr)?
|
||||
},
|
||||
negated,
|
||||
}
|
||||
},
|
||||
};
|
||||
self.expect_token(&Token::RParen)?;
|
||||
Ok(in_op)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue