diff --git a/src/tokenizer.rs b/src/tokenizer.rs index 6d0c86ff2..4186ec824 100644 --- a/src/tokenizer.rs +++ b/src/tokenizer.rs @@ -43,7 +43,8 @@ use sqlparser_derive::{Visit, VisitMut}; use crate::ast::DollarQuotedString; use crate::dialect::Dialect; use crate::dialect::{ - BigQueryDialect, DuckDbDialect, GenericDialect, PostgreSqlDialect, SnowflakeDialect, + BigQueryDialect, DuckDbDialect, GenericDialect, MySqlDialect, PostgreSqlDialect, + SnowflakeDialect, }; use crate::keywords::{Keyword, ALL_KEYWORDS, ALL_KEYWORDS_INDEX}; @@ -1140,7 +1141,7 @@ impl<'a> Tokenizer<'a> { } '{' => self.consume_and_return(chars, Token::LBrace), '}' => self.consume_and_return(chars, Token::RBrace), - '#' if dialect_of!(self is SnowflakeDialect | BigQueryDialect) => { + '#' if dialect_of!(self is SnowflakeDialect | BigQueryDialect | MySqlDialect) => { chars.next(); // consume the '#', starting a snowflake single-line comment let comment = self.tokenize_single_line_comment(chars); Ok(Some(Token::Whitespace(Whitespace::SingleLineComment { diff --git a/tests/sqlparser_common.rs b/tests/sqlparser_common.rs index 5327880a4..7140109b2 100644 --- a/tests/sqlparser_common.rs +++ b/tests/sqlparser_common.rs @@ -9923,7 +9923,11 @@ fn test_release_savepoint() { #[test] fn test_comment_hash_syntax() { let dialects = TestedDialects { - dialects: vec![Box::new(BigQueryDialect {}), Box::new(SnowflakeDialect {})], + dialects: vec![ + Box::new(BigQueryDialect {}), + Box::new(SnowflakeDialect {}), + Box::new(MySqlDialect {}), + ], options: None, }; let sql = r#"