Skip to content

Commit ed3e591

Browse files
committed
Address comments about dialect switching
1 parent 126b7b4 commit ed3e591

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

src/parser/mod.rs

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3961,11 +3961,7 @@ impl<'a> Parser<'a> {
39613961
.is_some();
39623962
let persistent = dialect_of!(self is DuckDbDialect)
39633963
&& self.parse_one_of_keywords(&[Keyword::PERSISTENT]).is_some();
3964-
let create_view_params = if dialect_of!(self is MySqlDialect | GenericDialect) {
3965-
self.parse_create_view_params()?
3966-
} else {
3967-
None
3968-
};
3964+
let create_view_params = self.parse_create_view_params()?;
39693965
if self.parse_keyword(Keyword::TABLE) {
39703966
self.parse_create_table(or_replace, temporary, global, transient)
39713967
} else if self.parse_keyword(Keyword::MATERIALIZED) || self.parse_keyword(Keyword::VIEW) {
@@ -4944,7 +4940,7 @@ impl<'a> Parser<'a> {
49444940
})
49454941
}
49464942

4947-
/// Parse optional algorithm, definer, and security context parameters for [MySQL]
4943+
/// Parse optional parameters for the `CREATE VIEW` statement supported by [MySQL].
49484944
///
49494945
/// [MySQL]: https://dev.mysql.com/doc/refman/9.1/en/create-view.html
49504946
fn parse_create_view_params(&mut self) -> Result<Option<CreateViewParams>, ParserError> {
@@ -8731,8 +8727,8 @@ impl<'a> Parser<'a> {
87318727
}
87328728

87338729
/// Parse a possibly qualified, possibly quoted identifier, optionally allowing for wildcards,
8734-
/// e.g. *, `foo`.*, or "foo"."bar"
8735-
pub fn parse_object_name_with_wildcards(
8730+
/// e.g. *, *.*, `foo`.*, or "foo"."bar"
8731+
fn parse_object_name_with_wildcards(
87368732
&mut self,
87378733
in_table_clause: bool,
87388734
allow_wildcards: bool,
@@ -11559,11 +11555,8 @@ impl<'a> Parser<'a> {
1155911555
} else {
1156011556
let object_type =
1156111557
self.parse_one_of_keywords(&[Keyword::SEQUENCE, Keyword::SCHEMA, Keyword::TABLE]);
11562-
let objects = if dialect_of!(self is MySqlDialect | GenericDialect) {
11563-
self.parse_comma_separated(|p| p.parse_object_name_with_wildcards(false, true))
11564-
} else {
11565-
self.parse_comma_separated(|p| p.parse_object_name(false))
11566-
};
11558+
let objects =
11559+
self.parse_comma_separated(|p| p.parse_object_name_with_wildcards(false, true));
1156711560
match object_type {
1156811561
Some(Keyword::SCHEMA) => GrantObjects::Schemas(objects?),
1156911562
Some(Keyword::SEQUENCE) => GrantObjects::Sequences(objects?),

0 commit comments

Comments
 (0)