File tree Expand file tree Collapse file tree 3 files changed +3
-10
lines changed Expand file tree Collapse file tree 3 files changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -2346,7 +2346,7 @@ impl fmt::Display for CreateFunction {
23462346 if let Some ( CreateFunctionBody :: Return ( function_body) ) = & self . function_body {
23472347 write ! ( f, " RETURN {function_body}" ) ?;
23482348 }
2349- if let Some ( CreateFunctionBody :: AsReturnSubquery ( function_body) ) = & self . function_body {
2349+ if let Some ( CreateFunctionBody :: AsReturnExpr ( function_body) ) = & self . function_body {
23502350 write ! ( f, " AS RETURN {function_body}" ) ?;
23512351 }
23522352 if let Some ( CreateFunctionBody :: AsReturnSelect ( function_body) ) = & self . function_body {
Original file line number Diff line number Diff line change @@ -8789,7 +8789,7 @@ pub enum CreateFunctionBody {
87898789 /// ```
87908790 ///
87918791 /// [MsSql]: https://learn.microsoft.com/en-us/sql/t-sql/statements/create-function-transact-sql
8792- AsReturnSubquery ( Expr ) ,
8792+ AsReturnExpr ( Expr ) ,
87938793
87948794 /// Function body expression using the 'AS RETURN' keywords, with an un-parenthesized SELECT query
87958795 ///
Original file line number Diff line number Diff line change @@ -5264,14 +5264,7 @@ impl<'a> Parser<'a> {
52645264 }))
52655265 } else if self.parse_keyword(Keyword::RETURN) {
52665266 if self.peek_token() == Token::LParen {
5267- let expr = self.parse_expr()?;
5268- if !matches!(expr, Expr::Subquery(_)) {
5269- parser_err!(
5270- "Expected a subquery after RETURN",
5271- self.peek_token().span.start
5272- )?
5273- }
5274- Some(CreateFunctionBody::AsReturnSubquery(expr))
5267+ Some(CreateFunctionBody::AsReturnExpr(self.parse_expr()?))
52755268 } else if self.peek_keyword(Keyword::SELECT) {
52765269 let select = self.parse_select()?;
52775270 Some(CreateFunctionBody::AsReturnSelect(select))
You can’t perform that action at this time.
0 commit comments