Skip to content

Commit 0a2082f

Browse files
committed
mysql support ALTER TABLE table_a DROP INDEX idx_a
1 parent 0d4967c commit 0a2082f

File tree

3 files changed

+1
-46
lines changed

3 files changed

+1
-46
lines changed

src/ast/mod.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3208,17 +3208,6 @@ pub enum Statement {
32083208
/// `CREATE INDEX`
32093209
/// ```
32103210
CreateIndex(CreateIndex),
3211-
/// DROP INDEX
3212-
///
3213-
/// ```sql
3214-
/// DROP INDEX index_name ON tbl_name
3215-
/// ```
3216-
/// See [MySql](https://dev.mysql.com/doc/refman/8.4/en/drop-index.html)
3217-
/// TODO: No support `[algorithm_option | lock_option]`
3218-
DropIndex {
3219-
index_name: ObjectName,
3220-
table_name: Option<ObjectName>,
3221-
},
32223211
/// ```sql
32233212
/// CREATE ROLE
32243213
/// ```
@@ -4930,17 +4919,6 @@ impl fmt::Display for Statement {
49304919
Ok(())
49314920
}
49324921
Statement::CreateIndex(create_index) => create_index.fmt(f),
4933-
Statement::DropIndex {
4934-
index_name,
4935-
table_name,
4936-
} => {
4937-
write!(f, "DROP INDEX")?;
4938-
match &table_name {
4939-
Some(table_name) => write!(f, " {index_name} ON {table_name}")?,
4940-
None => write!(f, " {index_name}")?,
4941-
};
4942-
Ok(())
4943-
}
49444922
Statement::CreateExtension {
49454923
name,
49464924
if_not_exists,

src/ast/spans.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,6 @@ impl Spanned for Statement {
421421
.chain(module_args.iter().map(|i| i.span)),
422422
),
423423
Statement::CreateIndex(create_index) => create_index.span(),
424-
Statement::DropIndex { .. } => Span::empty(),
425424
Statement::CreateRole { .. } => Span::empty(),
426425
Statement::CreateSecret { .. } => Span::empty(),
427426
Statement::CreateConnector { .. } => Span::empty(),

src/parser/mod.rs

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5353,24 +5353,6 @@ impl<'a> Parser<'a> {
53535353
})
53545354
}
53555355

5356-
/// Parse statements of the DropIndex type such as:
5357-
///
5358-
/// ```sql
5359-
/// DROP Index idx_name ON table_name
5360-
/// ```
5361-
pub fn parse_drop_index(&mut self) -> Result<Statement, ParserError> {
5362-
let index_name = self.parse_object_name(false)?;
5363-
let table_name = if self.parse_keyword(Keyword::ON) {
5364-
Some(self.parse_object_name(false)?)
5365-
} else {
5366-
None
5367-
};
5368-
Ok(Statement::DropIndex {
5369-
index_name,
5370-
table_name,
5371-
})
5372-
}
5373-
53745356
/// Parse statements of the DropTrigger type such as:
53755357
///
53765358
/// ```sql
@@ -6220,11 +6202,7 @@ impl<'a> Parser<'a> {
62206202
} else if self.parse_keywords(&[Keyword::MATERIALIZED, Keyword::VIEW]) {
62216203
ObjectType::MaterializedView
62226204
} else if self.parse_keyword(Keyword::INDEX) {
6223-
if dialect_of!(self is MySqlDialect){
6224-
return self.parse_drop_index();
6225-
}else {
6226-
ObjectType::Index
6227-
}
6205+
ObjectType::Index
62286206
} else if self.parse_keyword(Keyword::ROLE) {
62296207
ObjectType::Role
62306208
} else if self.parse_keyword(Keyword::SCHEMA) {

0 commit comments

Comments
 (0)