invm commented on code in PR #1734:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/1734#discussion_r1965350368


##########
src/parser/mod.rs:
##########
@@ -5061,20 +5066,19 @@ impl<'a> Parser<'a> {
     }
 
     pub fn parse_trigger_period(&mut self) -> Result<TriggerPeriod, 
ParserError> {
-        Ok(
-            match self.expect_one_of_keywords(&[
-                Keyword::BEFORE,
-                Keyword::AFTER,
-                Keyword::INSTEAD,
-            ])? {
-                Keyword::BEFORE => TriggerPeriod::Before,
-                Keyword::AFTER => TriggerPeriod::After,
-                Keyword::INSTEAD => self
-                    .expect_keyword_is(Keyword::OF)
-                    .map(|_| TriggerPeriod::InsteadOf)?,
-                _ => unreachable!(),
-            },
-        )
+        let allowed_keywords = if dialect_of!(self is MySqlDialect) {
+            vec![Keyword::BEFORE, Keyword::AFTER]
+        } else {
+            vec![Keyword::BEFORE, Keyword::AFTER, Keyword::INSTEAD]
+        };

Review Comment:
   Same here, the `INSTEAD` keyword is not a thing in mysql.
   
   I'm happy to hear other cleaner suggestions, I just tried to modify as 
little code as possible



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to