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 @@ -5267,14 +5267,7 @@ impl<'a> Parser<'a> {
52675267 }))
52685268 } else if self.parse_keyword(Keyword::RETURN) {
52695269 if self.peek_token() == Token::LParen {
5270- let expr = self.parse_expr()?;
5271- if !matches!(expr, Expr::Subquery(_)) {
5272- parser_err!(
5273- "Expected a subquery after RETURN",
5274- self.peek_token().span.start
5275- )?
5276- }
5277- Some(CreateFunctionBody::AsReturnSubquery(expr))
5270+ Some(CreateFunctionBody::AsReturnExpr(self.parse_expr()?))
52785271 } else if self.peek_keyword(Keyword::SELECT) {
52795272 let select = self.parse_select()?;
52805273 Some(CreateFunctionBody::AsReturnSelect(select))
You can’t perform that action at this time.
0 commit comments