@@ -1302,7 +1302,8 @@ impl<'a> Parser<'a> {
1302
1302
Keyword::POSITION if self.peek_token_ref().token == Token::LParen => {
1303
1303
Ok(Some(self.parse_position_expr(w.clone().into_ident(w_span))?))
1304
1304
}
1305
- Keyword::SUBSTRING => Ok(Some(self.parse_substring_expr()?)),
1305
+ Keyword::SUBSTR => Ok(Some(self.parse_substring_expr(true)?)),
1306
+ Keyword::SUBSTRING => Ok(Some(self.parse_substring_expr(false)?)),
1306
1307
Keyword::OVERLAY => Ok(Some(self.parse_overlay_expr()?)),
1307
1308
Keyword::TRIM => Ok(Some(self.parse_trim_expr()?)),
1308
1309
Keyword::INTERVAL => Ok(Some(self.parse_interval()?)),
@@ -2403,7 +2404,7 @@ impl<'a> Parser<'a> {
2403
2404
}
2404
2405
}
2405
2406
2406
- pub fn parse_substring_expr(&mut self) -> Result<Expr, ParserError> {
2407
+ pub fn parse_substring_expr(&mut self, shorthand: bool ) -> Result<Expr, ParserError> {
2407
2408
// PARSE SUBSTRING (EXPR [FROM 1] [FOR 3])
2408
2409
self.expect_token(&Token::LParen)?;
2409
2410
let expr = self.parse_expr()?;
@@ -2424,6 +2425,7 @@ impl<'a> Parser<'a> {
2424
2425
substring_from: from_expr.map(Box::new),
2425
2426
substring_for: to_expr.map(Box::new),
2426
2427
special,
2428
+ shorthand,
2427
2429
})
2428
2430
}
2429
2431
0 commit comments