File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -8096,7 +8096,7 @@ impl<'a> Parser<'a> {
8096
8096
pub fn parse_query_body ( & mut self , precedence : u8 ) -> Result < SetExpr , ParserError > {
8097
8097
// We parse the expression using a Pratt parser, as in `parse_expr()`.
8098
8098
// 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 ) {
8100
8100
SetExpr :: Select ( self . parse_select ( ) . map ( Box :: new) ?)
8101
8101
} else if self . consume_token ( & Token :: LParen ) {
8102
8102
// CTEs are not allowed here, but the parser currently accepts them
@@ -8115,6 +8115,17 @@ impl<'a> Parser<'a> {
8115
8115
) ;
8116
8116
} ;
8117
8117
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 > {
8118
8129
loop {
8119
8130
// The query can be optionally followed by a set operator:
8120
8131
let op = self . parse_set_operator ( & self . peek_token ( ) . token ) ;
You can’t perform that action at this time.
0 commit comments