Skip to content

Commit e2ec2a6

Browse files
committed
Reduce stack size to get tests to pass
1 parent b6a5d1d commit e2ec2a6

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/parser/mod.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8096,7 +8096,7 @@ impl<'a> Parser<'a> {
80968096
pub fn parse_query_body(&mut self, precedence: u8) -> Result<SetExpr, ParserError> {
80978097
// We parse the expression using a Pratt parser, as in `parse_expr()`.
80988098
// Start by parsing a restricted SELECT or a `(subquery)`:
8099-
let mut expr = if self.parse_keyword(Keyword::SELECT) {
8099+
let expr = if self.parse_keyword(Keyword::SELECT) {
81008100
SetExpr::Select(self.parse_select().map(Box::new)?)
81018101
} else if self.consume_token(&Token::LParen) {
81028102
// CTEs are not allowed here, but the parser currently accepts them
@@ -8115,6 +8115,17 @@ impl<'a> Parser<'a> {
81158115
);
81168116
};
81178117

8118+
self.parse_remaining_set_exprs(expr, precedence)
8119+
}
8120+
8121+
/// Parse any extra set expressions that may be present in a query body
8122+
///
8123+
/// (this is its own function to reduce required stack size in debug builds)
8124+
fn parse_remaining_set_exprs(
8125+
&mut self,
8126+
mut expr: SetExpr,
8127+
precedence: u8,
8128+
) -> Result<SetExpr, ParserError> {
81188129
loop {
81198130
// The query can be optionally followed by a set operator:
81208131
let op = self.parse_set_operator(&self.peek_token().token);

0 commit comments

Comments
 (0)