Skip to content

Commit c1596b8

Browse files
committed
Add MySql, BigQuery to all dialects
1 parent 914810d commit c1596b8

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/parser.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3727,6 +3727,8 @@ impl<'a> Parser<'a> {
37273727
// ignore the <separator> and treat the multiple strings as
37283728
// a single <literal>."
37293729
Token::SingleQuotedString(s) => Ok(Some(Ident::with_quote('\'', s))),
3730+
// Support for MySql dialect double qouted string, `AS "HOUR"` for example
3731+
Token::DoubleQuotedString(s) => Ok(Some(Ident::with_quote('\"', s))),
37303732
not_an_ident => {
37313733
if after_as {
37323734
return self.expected("an identifier after AS", not_an_ident);
@@ -3810,6 +3812,7 @@ impl<'a> Parser<'a> {
38103812
match self.next_token() {
38113813
Token::Word(w) => Ok(w.to_ident()),
38123814
Token::SingleQuotedString(s) => Ok(Ident::with_quote('\'', s)),
3815+
Token::DoubleQuotedString(s) => Ok(Ident::with_quote('\"', s)),
38133816
unexpected => self.expected("identifier", unexpected),
38143817
}
38153818
}

src/test_utils.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ pub fn all_dialects() -> TestedDialects {
142142
Box::new(SnowflakeDialect {}),
143143
Box::new(HiveDialect {}),
144144
Box::new(RedshiftSqlDialect {}),
145+
Box::new(MySqlDialect {}),
146+
Box::new(BigQueryDialect {}),
145147
],
146148
}
147149
}

0 commit comments

Comments
 (0)