@@ -15597,25 +15597,6 @@ impl<'a> Parser<'a> {
15597
15597
}
15598
15598
15599
15599
pub fn parse_begin_exception_end(&mut self) -> Result<Statement, ParserError> {
15600
- // Snowflake allows BEGIN as a standalone transaction statement (no END).
15601
- // If the next token is a semicolon or EOF, treat it as a standalone BEGIN.
15602
- if dialect_of!(self is SnowflakeDialect) {
15603
- match &self.peek_token_ref().token {
15604
- Token::SemiColon | Token::EOF => {
15605
- return Ok(Statement::StartTransaction {
15606
- begin: true,
15607
- statements: vec![],
15608
- exception: None,
15609
- has_end_keyword: false,
15610
- transaction: None,
15611
- modifier: None,
15612
- modes: Default::default(),
15613
- })
15614
- }
15615
- _ => {}
15616
- }
15617
- }
15618
-
15619
15600
let statements = self.parse_statement_list(&[Keyword::EXCEPTION, Keyword::END])?;
15620
15601
15621
15602
let exception = if self.parse_keyword(Keyword::EXCEPTION) {
@@ -15647,30 +15628,16 @@ impl<'a> Parser<'a> {
15647
15628
None
15648
15629
};
15649
15630
15650
- if dialect_of!(self is SnowflakeDialect) {
15651
- // Make END optional for Snowflake. If present, set flag accordingly.
15652
- let has_end = self.parse_keyword(Keyword::END);
15653
- Ok(Statement::StartTransaction {
15654
- begin: true,
15655
- statements,
15656
- exception,
15657
- has_end_keyword: has_end,
15658
- transaction: None,
15659
- modifier: None,
15660
- modes: Default::default(),
15661
- })
15662
- } else {
15663
- self.expect_keyword(Keyword::END)?;
15664
- Ok(Statement::StartTransaction {
15665
- begin: true,
15666
- statements,
15667
- exception,
15668
- has_end_keyword: true,
15669
- transaction: None,
15670
- modifier: None,
15671
- modes: Default::default(),
15672
- })
15673
- }
15631
+ self.expect_keyword(Keyword::END)?;
15632
+ Ok(Statement::StartTransaction {
15633
+ begin: true,
15634
+ statements,
15635
+ exception,
15636
+ has_end_keyword: true,
15637
+ transaction: None,
15638
+ modifier: None,
15639
+ modes: Default::default(),
15640
+ })
15674
15641
}
15675
15642
15676
15643
pub fn parse_end(&mut self) -> Result<Statement, ParserError> {
0 commit comments