File tree 3 files changed +3
-10
lines changed
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 {
2346
2346
if let Some ( CreateFunctionBody :: Return ( function_body) ) = & self . function_body {
2347
2347
write ! ( f, " RETURN {function_body}" ) ?;
2348
2348
}
2349
- if let Some ( CreateFunctionBody :: AsReturnSubquery ( function_body) ) = & self . function_body {
2349
+ if let Some ( CreateFunctionBody :: AsReturnExpr ( function_body) ) = & self . function_body {
2350
2350
write ! ( f, " AS RETURN {function_body}" ) ?;
2351
2351
}
2352
2352
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 {
8789
8789
/// ```
8790
8790
///
8791
8791
/// [MsSql]: https://learn.microsoft.com/en-us/sql/t-sql/statements/create-function-transact-sql
8792
- AsReturnSubquery ( Expr ) ,
8792
+ AsReturnExpr ( Expr ) ,
8793
8793
8794
8794
/// Function body expression using the 'AS RETURN' keywords, with an un-parenthesized SELECT query
8795
8795
///
Original file line number Diff line number Diff line change @@ -5264,14 +5264,7 @@ impl<'a> Parser<'a> {
5264
5264
}))
5265
5265
} else if self.parse_keyword(Keyword::RETURN) {
5266
5266
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()?))
5275
5268
} else if self.peek_keyword(Keyword::SELECT) {
5276
5269
let select = self.parse_select()?;
5277
5270
Some(CreateFunctionBody::AsReturnSelect(select))
You can’t perform that action at this time.
0 commit comments